diff --git a/server.py b/server.py index b3f1d5b..9241bf6 100644 --- a/server.py +++ b/server.py @@ -67,6 +67,11 @@ def getAddress(coin: str) -> str: address = file.read() return address +def find(name, path): + for root, dirs, files in os.walk(path): + if name in files: + return os.path.join(root, name) + # Assets routes @app.route("/assets/") @@ -765,7 +770,7 @@ def supersecretpath(): @app.route("/") -def catch_all(path): +def catch_all(path: str): global handshake_scripts # If localhost, don't load handshake if ( @@ -793,6 +798,15 @@ def catch_all(path): path.strip("/") + ".html", handshake_scripts=handshake_scripts, sites=sites ) + # Try to find a file matching + if path.count("/") < 1: + # Try to find a file matching + filename = find(path, "templates") + if filename: + return send_file(filename) + + + return render_template("404.html"), 404 diff --git a/templates/assets/logo.png b/templates/assets/logo.png deleted file mode 100644 index bb1c018..0000000 Binary files a/templates/assets/logo.png and /dev/null differ diff --git a/templates/assets/logo.webp b/templates/assets/logo.webp deleted file mode 100644 index a45c467..0000000 Binary files a/templates/assets/logo.webp and /dev/null differ