import tornado.ioloop import tornado.web PORT = 8080 class TestHandler(tornado.web.RequestHandler): def get(self): self.write({"Result": "ok"}) def post(self): self.write({"Result":"ok"}) def make_app(): return tornado.web.Application([ (r"/test1", TestHandler), ]) if __name__ == "__main__": app = make_app() app.listen(PORT) tornado.ioloop.IOLoop.current().start()