1
0
Fork 0
forked from sr2/cloud-api

fix: only serve frontend if present in prod

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 Application root file: Inits the FastAPI application
""" """
import os.path
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from typing import AsyncGenerator from typing import AsyncGenerator
@ -78,4 +78,5 @@ if settings.DISABLE_AUTH and (settings.ENVIRONMENT == Environment.LOCAL):
app.include_router(api_router) 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