react frontend
This commit is contained in:
parent
e93493e693
commit
fe68a052d3
30 changed files with 44 additions and 1 deletions
4
main.py
4
main.py
|
|
@ -131,10 +131,14 @@ def serve_csv():
|
|||
|
||||
@app.route("/<path:path>")
|
||||
def catch_all(path):
|
||||
if path.startswith("_next/") or path.startswith("templates/_next/"):
|
||||
# Let frontend handle it (or you can serve static files here if needed)
|
||||
return "", 404 # Or use `send_from_directory()` if serving files
|
||||
if os.path.exists(CSV_FILE):
|
||||
return send_file(CSV_FILE, mimetype="text/csv", as_attachment=False)
|
||||
return "CSV not ready yet.", 503
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
thread = threading.Thread(target=background_updater, daemon=True)
|
||||
thread.start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue