0
如何在Tornado服務器裝入Bottle應用程序? Here is my code龍捲風 - 裝瓶應用程序
如何在Tornado服務器裝入Bottle應用程序? Here is my code龍捲風 - 裝瓶應用程序
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()
我已經創建了一個項目,GitHub的https://github.com/cime/bottle-tornadosocket :) – redman 2012-04-26 21:38:14