如何在Tornado服务器中安装Bottle应用程序? Here is my code
答案 0 :(得分:2)
bottle.default_app()
返回一个WSGI可调用:
if __name__ == "__main__":
bottle_app = bottle.default_app()
bottle_handler = tornado.wsgi.WSGIContainer(bottle_app)
HTTPServer(Application([(r"/ws", WSHandler),
(r"/css/(.*)", StaticFileHandler, {"path": "./css/"}),
(r"/js/(.*)", StaticFileHandler, {"path": "./js/"}),
(r"/img/(.*)", StaticFileHandler, {"path": "./img/"}),
("/(.*)", bottle_handler)])
).listen(1024)
IOLoop.instance().start()