diff --git a/backend/main.py b/backend/main.py index 4490cbb..44d780c 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1401,6 +1401,16 @@ async def knigge_page(): # SPA Fallback — ALLE nicht-API-Routen gehen zur index.html @app.get("/{full_path:path}") async def spa_fallback(full_path: str): + IS_STAGING = os.getenv("STAGING", "false").lower() == "true" + if IS_STAGING: + from fastapi.responses import HTMLResponse + with open(f"{STATIC_DIR}/index.html", encoding="utf-8") as f: + html = f.read() + html = html.replace( + '', + '', + ) + return HTMLResponse(content=html, headers={"Cache-Control": "no-cache"}) return FileResponse( f"{STATIC_DIR}/index.html", headers={"Cache-Control": "no-cache"} diff --git a/backend/static/icons/icon-180-staging.png b/backend/static/icons/icon-180-staging.png new file mode 100644 index 0000000..fc2be5c Binary files /dev/null and b/backend/static/icons/icon-180-staging.png differ diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 697e7d6..4463bbd 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '490'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '491'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen const APP_VERSION = '1.0.0'; // ← semantische Version, wird bei make release gesetzt const IS_STAGING = location.hostname === 'staging.banyaro.app'; diff --git a/backend/static/sw.js b/backend/static/sw.js index c28125f..8b5ea5f 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -3,7 +3,7 @@ Offline-Cache + Push Notifications + Tile-Cache ============================================================ */ -const CACHE_VERSION = 'by-v513'; +const CACHE_VERSION = 'by-v514'; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache