Serve static content from the root path
This commit is contained in:
parent
eb2d9e5186
commit
d348245090
1 changed files with 5 additions and 4 deletions
|
@ -102,10 +102,11 @@ def make_app(settings) -> tornado.web.Application:
|
||||||
if static_path := settings.get("static"):
|
if static_path := settings.get("static"):
|
||||||
paths.extend(
|
paths.extend(
|
||||||
[
|
[
|
||||||
(r"/", tornado.web.RedirectHandler, {"url": "/app/index.html"}),
|
(
|
||||||
(r"/app", tornado.web.RedirectHandler, {"url": "/app/index.html"}),
|
r"/(.*)",
|
||||||
(r"/app/", tornado.web.RedirectHandler, {"url": "/app/index.html"}),
|
tornado.web.StaticFileHandler,
|
||||||
(r"/app/(.*)", tornado.web.StaticFileHandler, {"path": static_path}),
|
{"path": static_path, "default_filename": "index.html"},
|
||||||
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
return tornado.web.Application(paths, **settings)
|
return tornado.web.Application(paths, **settings)
|
||||||
|
|
Loading…
Reference in a new issue