Skip to content
Proyek

Tentang

Dukungan AWS Lambda untuk aplikasi ASGI

Pengembangan web dan aplikasi

Cara angka ini diukur

Yang dapat Anda lakukan

  • Event handlers for API Gateway HTTP and REST APIs, Application Load Balancer, Function URLs, and CloudFront Lambda@Edge.
  • Compatibility with ASGI application frameworks, such as Starlette, FastAPI, Quart and Django.
  • Support for binary media types and payload compression in API Gateway using GZip or Brotli.
  • Works with existing deployment and configuration tools, including Serverless Framework and AWS SAM.

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
+1
dalam 1 bulan
+1

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

Mangum

Package version PyPI - Python Version

Mangum is an adapter for running ASGI applications in AWS Lambda to handle Function URL, API Gateway, ALB, and Lambda@Edge events.

Documentation: https://mangum.fastapiexpert.com/

Features

Installation

pip install mangum

Example

from mangum import Mangum

async def app(scope, receive, send):
    await send(
        {
            "type": "http.response.start",
            "status": 200,
            "headers": [[b"content-type", b"text/plain; charset=utf-8"]],
        }
    )
    await send({"type": "http.response.body", "body": b"Hello, world!"})


handler = Mangum(app, lifespan="off")

Or using a framework:

from fastapi import FastAPI
from mangum import Mangum

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
    return {"item_id": item_id, "q": q}

handler = Mangum(app, lifespan="off")

Jelajahi proyek terkait

Memuat…