From b9eea92668e0a229b2509ff0ba35d59f37420b52 Mon Sep 17 00:00:00 2001 From: Kosh Date: Wed, 18 Oct 2023 12:59:24 +0530 Subject: [PATCH] Add compatibility for a get request to /index.html --- backend/rest_api.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/rest_api.py b/backend/rest_api.py index 96fe3d1..868ed69 100644 --- a/backend/rest_api.py +++ b/backend/rest_api.py @@ -23,11 +23,18 @@ def handle_first_launched(): ======= @app.route('/favicon.ico') -def favicon(): - favicon_path = path.join(app.root_path, '../frontend/static', 'favicon.ico') +def favicon() -> Response: + favicon_path: str = path.join(app.root_path, '../frontend/static', 'favicon.ico') return send_file(favicon_path, mimetype='image/vnd.microsoft.icon') >>>>>>> d7982e1 (Add error message to login, Fix Internal Error 500) + +@app.route("/index.html") +def handle_index() -> Response: + index_path: str = path.join(app.root_path, "../frontend/html", "index.html") + return send_file(index_path, mimetype="text/html") + + @app.get("/") @app.get("/") def handle_get(url_path: str = "html/index.html") -> Response: