from microdot.wsgi import Microdot
app = Microdot()
html = '''
Microdot Example Page
'''
@app.route('/')
def hello(request):
return html, 200, {'Content-Type': 'text/html'}
@app.route('/shutdown')
def shutdown(request):
request.app.shutdown()
return 'The server is shutting down...'
if __name__ == '__main__':
print('''Use a WSGI web server to run this applicaton.
Example:
gunicorn hello_wsgi:app
''')