import ssl from microdot import Microdot app = Microdot() html = ''' Microdot Example Page

Microdot Example Page

Hello from Microdot!

Click to shutdown the server

''' @app.route('/') async def hello(request): return html, 200, {'Content-Type': 'text/html'} @app.route('/shutdown') async def shutdown(request): request.app.shutdown() return 'The server is shutting down...' sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) sslctx.load_cert_chain('cert.pem', 'key.pem') app.run(port=4443, debug=True, ssl=sslctx)