From c56bf4fb49c986e9b653f635a81937a3ef433a5e Mon Sep 17 00:00:00 2001 From: retoor Date: Fri, 9 May 2025 02:30:43 +0200 Subject: [PATCH] Update. --- src/snek/app.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/snek/app.py b/src/snek/app.py index c340eef..605934a 100644 --- a/src/snek/app.py +++ b/src/snek/app.py @@ -137,7 +137,12 @@ class Application(BaseApplication): def setup_router(self): self.router.add_get("/", IndexView) - self.router.add_get("/static/{file_path:.*}", self.static_handler) + self.router.add_static( + "/", + pathlib.Path(__file__).parent.joinpath("static"), + name="static", + show_index=True, + ) self.router.add_view("/profiler.html", profiler_handler) self.router.add_view("/about.html", AboutHTMLView) self.router.add_view("/about.md", AboutMDView) @@ -177,7 +182,9 @@ class Application(BaseApplication): "/docs", DocsApplication(path=pathlib.Path(__file__).parent.joinpath("docs")), ) - + + #self.router.add_get("/{file_path:.*}", self.static_handler) + async def handle_test(self, request): return await self.render_template( @@ -259,7 +266,6 @@ class Application(BaseApplication): paths = [] - uid = request.session.get("uid") if uid: user_static_path = await self.services.user.get_static_path(uid)