- Add FastAPI app with title 'Debate API' v1.0.0 - Configure pydantic-settings for environment-based configuration - Create /health endpoint at root level - Create /api/v1/health and /api/v1/health/ready endpoints - Disable docs/redoc in production environment
24 lines
672 B
Python
24 lines
672 B
Python
"""FastAPI application entry point."""
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from backend.app.api.v1.router import api_router
|
|
from backend.app.core.config import settings
|
|
|
|
app = FastAPI(
|
|
title="Debate API",
|
|
version="1.0.0",
|
|
description="Backend API for Debate - Linux distribution customization platform",
|
|
docs_url="/docs" if not settings.is_production else None,
|
|
redoc_url="/redoc" if not settings.is_production else None,
|
|
debug=settings.debug,
|
|
)
|
|
|
|
# Include API routers
|
|
app.include_router(api_router, prefix="/api/v1")
|
|
|
|
|
|
@app.get("/health")
|
|
async def root_health() -> dict[str, str]:
|
|
"""Root health check endpoint."""
|
|
return {"status": "healthy"}
|