Add uri root path before all routes.

This commit is contained in:
Graham Dumpleton
2018-08-23 11:53:38 +10:00
parent 1984e4b869
commit 611f2e30d6

View File

@@ -31,10 +31,15 @@ class url(object):
self.url = url
def __call__(self, cls):
if tornado.options.options.uri_root_path:
url = tornado.options.options.uri_root_path.rstrip('/') + self.url
else:
url = self.url
application.add_handlers(
r'.*$',
(tornado.web.url(self.url, cls, name=cls.__name__),)
(tornado.web.url(url, cls, name=cls.__name__),)
)
return cls