debate/backend/app/main.py
Mikkel Georgsen 519333e598 feat(01-01): create FastAPI application structure with health endpoint
- 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
2026-01-25 20:09:21 +00:00

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"}