from microdot import Microdot, Response
app = Microdot()
htmldoc = '''
Microdot Example Page
'''
@app.route('/')
def hello(request):
return Response(body=htmldoc, headers={'Content-Type': 'text/html'})
@app.route('/shutdown')
def shutdown(request):
request.app.shutdown()
return 'The server is shutting down...'
app.run(debug=True)