Fix: Staging-Icon für iOS — apple-touch-icon dynamisch für Staging-Umgebung

- icon-180-staging.png erstellt (Helm-Icon, 180px für iOS-Homescreen)
- spa_fallback: Staging-HTML ersetzt apple-touch-icon-Link dynamisch
- SW by-v514, APP_VER 491
This commit is contained in:
rene 2026-04-29 21:07:00 +02:00
parent 15d8347e16
commit 810c1a79dc
4 changed files with 12 additions and 2 deletions

View file

@ -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(
'<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180.png">',
'<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180-staging.png">',
)
return HTMLResponse(content=html, headers={"Cache-Control": "no-cache"})
return FileResponse(
f"{STATIC_DIR}/index.html",
headers={"Cache-Control": "no-cache"}