NanoASGI
Asynchronous Python Web Framework
NanoASGI is a fast
Download and Install
Download
Or install via pip
pip install NanoASGI
Example
# example.py
from nanoasgi import App, Response
app = App()
@app.on('startup')
async def on_startup():
print('Ready to serve requests')
@app.on('shutdown')
async def on_shutdown():
print('Shutting down')
@app.route('GET', '/api/hello/{name}/')
async def hello_handler(request, name):
return Response(
{'result': f'Hello {name}!'},
status=200,
headers=[('Content-Type', 'application/json')],
)
Then run your app with your favourite ASGI server.
uvicorn example:app
Status
License
Code and documentation are available according to the MIT License