Created
October 3, 2018 16:41
-
-
Save RichardBray/4a6b8359d94c1eb1153d1006259cb2b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from tornado.web import Application, RequestHandler | |
from tornado.ioloop import IOLoop | |
class HelloHandler(RequestHandler): | |
def get(self): | |
self.write({'message': 'hello world'}) | |
def make_app(): | |
urls = [("/", HelloHandler)] | |
return Application(urls) | |
if __name__ == '__main__': | |
app = make_app() | |
app.listen(3000) | |
IOLoop.instance().start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment