From 0c948561a899a65ffd638c726ced1bbde58d19b2 Mon Sep 17 00:00:00 2001 From: krateng Date: Tue, 26 Apr 2022 19:41:23 +0200 Subject: [PATCH] Added more generalized support for static user files, GH-135 --- maloja/server.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maloja/server.py b/maloja/server.py index 8bbc001..cf96a92 100644 --- a/maloja/server.py +++ b/maloja/server.py @@ -182,6 +182,15 @@ def static(path): response.set_header("Cache-Control", "public, max-age=3600") return response +# static files not supplied by the package +@webserver.get("/static_custom//") +def static_custom(category,path): + rootpath = { + 'css':data_dir['css']() + } + response = static_file(path,root=rootpath[category]) + response.set_header("Cache-Control", "public, max-age=3600") + return response ### DYNAMIC