feat: Implement initial FastAPI application structure with configuration, core services, and an admin UI.

This commit is contained in:
2026-01-29 13:15:26 +08:00
parent 9cb938be9a
commit a5300eb379
4 changed files with 22 additions and 5 deletions

View File

@@ -17,7 +17,16 @@ from app.api.endpoints import auth
from app.api import admin_backend
def create_application() -> FastAPI:
application = FastAPI(title=settings.PROJECT_NAME)
# Disable docs and redoc in production
docs_url = "/docs" if settings.ENVIRONMENT == "development" else None
redoc_url = "/redoc" if settings.ENVIRONMENT == "development" else None
application = FastAPI(
title=settings.PROJECT_NAME,
docs_url=docs_url,
redoc_url=redoc_url
)
# Mount Static Files
application.mount("/static", StaticFiles(directory="app/static"), name="static")
@@ -53,4 +62,8 @@ async def admin_panel():
@app.get("/")
async def root():
return {"message": "Welcome to Storyline AI Gateway", "docs": "/docs"}
response = {"message": "Welcome to Storyline AI Gateway"}
if settings.ENVIRONMENT == "development":
response["docs"] = "/docs"
return response