|
5 months ago | |
---|---|---|
README.md | 5 months ago |
轻量级 ASGI 框架,构建异步 Web 项目
pip install starlette
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
async def homepage(request):
return JSONResponse({'hello': 'world'})
app = Starlette(debug=True, routes=[
Route('/', homepage),
])
uvicorn example:app