From c2f7f32ddc2d83fe3489a06b4582f0f4c49465f7 Mon Sep 17 00:00:00 2001 From: ditaajipratama Date: Wed, 31 Jul 2024 10:33:24 +0700 Subject: [PATCH] Fixing wrong routes in core staticdir --- core/staticdir.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/staticdir.py b/core/staticdir.py index 487dffd..02df303 100644 --- a/core/staticdir.py +++ b/core/staticdir.py @@ -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) )