Added more generalized support for static user files, GH-135

This commit is contained in:
krateng 2022-04-26 19:41:23 +02:00
parent 02c77a5e31
commit 0c948561a8
1 changed files with 9 additions and 0 deletions

View File

@ -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/<category>/<path:path>")
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