from microdot import Microdot, Response app = Microdot() htmldoc = ''' Microdot Example Page

Microdot Example Page

Hello from Microdot!

Click to shutdown the server

''' @app.route('/') def hello(request): return htmldoc, 200, {'Content-Type': 'text/html'} @app.route('/shutdown') def shutdown(request): request.app.shutdown() return 'The server is shutting down...' app.run(debug=True)