Fixing wrong routes in core staticdir

This commit is contained in:
Dita Aji Pratama 2024-07-31 10:33:24 +07:00
parent 81ff500200
commit c2f7f32ddc

View File

@ -1,9 +1,7 @@
from bottle import Bottle, get, static_file
from bottle import Bottle, static_file
from config import directory
app = Bottle()
for items in directory.static:
@app.get(items['route'])
def static_items(filepath):
return static_file(filepath, root=items['root'])
for item in directory.static:
app.route(item['route'], "GET", lambda filepath, root=item['root']: static_file(filepath, root=root) )