Skip to content

Instantly share code, notes, and snippets.

@waghanza
Created July 3, 2018 09:04
Show Gist options
  • Save waghanza/874dfb9daf907e6a19c85939f042cd96 to your computer and use it in GitHub Desktop.
Save waghanza/874dfb9daf907e6a19c85939f042cd96 to your computer and use it in GitHub Desktop.
import tornado.httpserver
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write('')
class UserHandler(tornado.web.RequestHandler):
def post(self):
self.write('')
class UserInfoHandler(tornado.web.RequestHandler):
def get(self, id):
self.write(id)
app = tornado.web.Application([(r'/', MainHandler),
(r"/user", UserHandler),
(r"/user/(\d+)", UserInfoHandler)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment