Last active
January 12, 2019 00:08
-
-
Save andreadipersio/7526464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.ioloop | |
import tornado.web | |
# http://www.tornadoweb.org/en/stable/options.html | |
from tornado.options import parse_command_line, define, options | |
define("port", default=8888) | |
define("debug", default=False) | |
class MainHandler(tornado.web.RequestHandler): | |
# http://www.tornadoweb.org/en/branch3.1/web.html#tornado.web.RequestHandler.compute_etag | |
def compute_etag(self): | |
return None | |
def get(self): | |
self.write("Hello, world") | |
handlers = [ | |
(r"/", MainHandler), | |
] | |
if __name__ == "__main__": | |
parse_command_line() | |
application = tornado.web.Application(handlers, debug=options.debug) | |
application.listen(options.port) | |
tornado.ioloop.IOLoop.instance().start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment