Serve static content from the root path

This commit is contained in:
Correl Roush 2021-07-15 21:22:13 -04:00
parent eb2d9e5186
commit d348245090

View file

@ -102,10 +102,11 @@ def make_app(settings) -> tornado.web.Application:
if static_path := settings.get("static"):
paths.extend(
[
(r"/", tornado.web.RedirectHandler, {"url": "/app/index.html"}),
(r"/app", tornado.web.RedirectHandler, {"url": "/app/index.html"}),
(r"/app/", tornado.web.RedirectHandler, {"url": "/app/index.html"}),
(r"/app/(.*)", tornado.web.StaticFileHandler, {"path": static_path}),
(
r"/(.*)",
tornado.web.StaticFileHandler,
{"path": static_path, "default_filename": "index.html"},
),
]
)
return tornado.web.Application(paths, **settings)