Fix Extension setup and factory import.

Moved ReactRouterHandler to be with the other handlers
This commit is contained in:
Nick Steel
2020-01-07 23:28:34 +00:00
parent e2962f67f0
commit 83fbc65cfa
2 changed files with 24 additions and 28 deletions

View File

@ -233,4 +233,19 @@ class HttpHandler(tornado.web.RequestHandler):
self.finish()
##
# Customised handler for react router URLS
#
# This routes all URLs to the same path, so that React can handle the path etc
##
class ReactRouterHandler(tornado.web.StaticFileHandler):
def initialize(self, path):
self.path = path
self.absolute_path = path
self.dirname = path.parent
self.filename = path.name
super().initialize(self.dirname)
def get(self, path=None, include_body=True):
return super().get(self.path, include_body)