Matthias Nott
2026-02-21 15c6d258137464aad5bbcc53f6044ad628849048
app/main.py
....@@ -51,10 +51,11 @@
5151 app.include_router(system.router, prefix="/api/system", tags=["system"])
5252
5353 # ---------------------------------------------------------------------------
54
-# Static files – serve the frontend SPA at /
55
-# Mount last so API routes take precedence
54
+# Static files – serve CSS/JS at /static and HTML at /
55
+# Mount /static first for explicit asset paths, then / for SPA fallback
5656 # ---------------------------------------------------------------------------
5757 if _STATIC_DIR.exists():
58
+ app.mount("/static", StaticFiles(directory=str(_STATIC_DIR)), name="static-assets")
5859 app.mount("/", StaticFiles(directory=str(_STATIC_DIR), html=True), name="static")
5960 else:
6061 logger.warning("Static directory not found at %s – frontend will not be served", _STATIC_DIR)