From 9b0474ef3a61e413b3d6b8c2e20899d691e9d462 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 10 Aug 2021 12:55:04 -1000 Subject: [PATCH] asu: always host json and store folders in production this should be hosted by a real server Signed-off-by: Paul Spooren --- asu/asu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/asu/asu.py b/asu/asu.py index 1c5447d3..c07991f1 100644 --- a/asu/asu.py +++ b/asu/asu.py @@ -48,14 +48,14 @@ def create_app(test_config: dict = None) -> Flask: (Path().cwd()).mkdir(exist_ok=True, parents=True) - @app.route("/") - @app.route("/") - def root(path="index.html"): - return send_from_directory(Path().cwd() / "public", path) + @app.route("/json/") + @app.route("/json/") + def json_path(path="index.html"): + return send_from_directory(app.config["JSON_PATH"], path) @app.route("/store/") @app.route("/store/") - def store(path="index.html"): + def store_path(path="index.html"): return send_from_directory(app.config["STORE_PATH"], path) from . import janitor