fix: serve manifest.webmanifest and other root files in SPA catch-all
This commit is contained in:
@@ -51,7 +51,13 @@ if FRONTEND_DIST.exists():
|
||||
|
||||
@app.get("/{full_path:path}")
|
||||
def spa(full_path: str):
|
||||
# Falls die Datei direkt in FRONTEND_DIST liegt (z.B. manifest.webmanifest, favicon.ico), liefere sie aus
|
||||
target = FRONTEND_DIST / full_path
|
||||
if target.is_file():
|
||||
return FileResponse(target)
|
||||
|
||||
index = FRONTEND_DIST / "index.html"
|
||||
if index.exists():
|
||||
return FileResponse(index)
|
||||
return {"detail": "frontend not built"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user