Files
Anurag 50ee57407e feat: add example for starlette.io (#72)
* feat: add example for starlette.io

* feat: link additional documentation

* feat: dev hot reload docker command
2021-04-10 01:04:02 -07:00

13 lines
302 B
Python

from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
async def homepage(request):
return JSONResponse({"Choo Choo": "Welcome to your Starlette app 🚅"})
app = Starlette(debug=True, routes=[
Route('/', homepage),
])