fix: only serve frontend if present in prod
Some checks failed
ci / ruff (push) Failing after 3s
ci / ty (push) Failing after 4s
ci / tests (push) Failing after 15s
ci / build (push) Has been cancelled

This commit is contained in:
Iain Learmonth 2026-06-22 14:42:13 +01:00
parent 1384ee7bd6
commit d395b01997
2 changed files with 3 additions and 2 deletions

View file

@ -1,7 +1,7 @@
"""
Application root file: Inits the FastAPI application
"""
import os.path
from contextlib import asynccontextmanager
from typing import AsyncGenerator
@ -78,4 +78,5 @@ if settings.DISABLE_AUTH and (settings.ENVIRONMENT == Environment.LOCAL):
app.include_router(api_router)
app.frontend("/ui", directory="/app/static", fallback="index.html")
if os.path.exists("/app/static"):
app.frontend("/ui", directory="/app/static", fallback="index.html")

View file