from microdot_asgi import Microdot app = Microdot() htmldoc = ''' Microdot Example Page

Microdot Example Page

Hello from Microdot!

Click to shutdown the server

''' @app.route('/') async def hello(request): return htmldoc, 200, {'Content-Type': 'text/html'} @app.route('/shutdown') async def shutdown(request): request.app.shutdown() return 'The server is shutting down...' if __name__ == '__main__': print('''Use an ASGI web server to run this applicaton. Example: uvicorn hello_asgi:app ''')