From 099acd0eccdd1e597af67e92853cd4ed0de93f1f 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 a30d825..9dd1f8a 100644 --- a/backend/rest_api.py +++ b/backend/rest_api.py @@ -21,10 +21,17 @@ 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') + +@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: