fix: only serve frontend if present in prod
This commit is contained in:
parent
1384ee7bd6
commit
d395b01997
2 changed files with 3 additions and 2 deletions
|
|
@ -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")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue