|
@@ -318,11 +318,16 @@ async def get_manifest_json():
|
|
|
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
|
|
app.mount("/cache", StaticFiles(directory=CACHE_DIR), name="cache")
|
|
|
|
|
|
-app.mount(
|
|
|
- "/",
|
|
|
- SPAStaticFiles(directory=FRONTEND_BUILD_DIR, html=True),
|
|
|
- name="spa-static-files",
|
|
|
-)
|
|
|
+if os.path.exists(FRONTEND_BUILD_DIR):
|
|
|
+ app.mount(
|
|
|
+ "/",
|
|
|
+ SPAStaticFiles(directory=FRONTEND_BUILD_DIR, html=True),
|
|
|
+ name="spa-static-files",
|
|
|
+ )
|
|
|
+else:
|
|
|
+ log.warning(
|
|
|
+ f"Frontend build directory not found at '{FRONTEND_BUILD_DIR}'. Serving API only."
|
|
|
+ )
|
|
|
|
|
|
|
|
|
@app.on_event("shutdown")
|