Reputation: 2165
How do you mount Bottle app in Tornado server? Here is my code
Upvotes: 0
Views: 1286
Reputation: 4199
bottle.default_app()
returns a WSGI callable:
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()
Upvotes: 2