feat: Implement initial FastAPI application structure with configuration, core services, and an admin UI.
This commit is contained in:
17
app/main.py
17
app/main.py
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user