Kludex/mangum
소개
ASGI 애플리케이션을 위한 AWS Lambda 지원
웹 및 앱 개발What you can do
- 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.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- +1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalMangum
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
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.
Startup and shutdown lifespan events.
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")
관련 프로젝트 살펴보기
불러오는 중…