Skip to content

Instantly share code, notes, and snippets.

@RichardBray
Created October 3, 2018 16:41
Show Gist options
  • Save RichardBray/4a6b8359d94c1eb1153d1006259cb2b1 to your computer and use it in GitHub Desktop.
Save RichardBray/4a6b8359d94c1eb1153d1006259cb2b1 to your computer and use it in GitHub Desktop.
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