Skip to content

Instantly share code, notes, and snippets.

@an01f01
Created February 11, 2021 20:54
Show Gist options
  • Save an01f01/bcd0892b466411472c9ae6b53b10ee7d to your computer and use it in GitHub Desktop.
Save an01f01/bcd0892b466411472c9ae6b53b10ee7d to your computer and use it in GitHub Desktop.
# Define web app
# (The only routes that contain "." should be static files, the "." is neccessary for the extension
# dont make new, non-static routes containing "." or else the static file handler will attempt to handle the request)
application = tornado.web.Application([
(r"/", StatusHandler),
], **settings)
application.listen(80)
http_server = tornado.httpserver.HTTPServer(
application,
ssl_options = {
"certfile": os.path.join("../certs/", "ssl_app_cert.crt"),
"keyfile": os.path.join("../certs/", "ssl_app_key.key")'
})
# Start web app
http_server.listen(443)
tornado.ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment