feat: Update API documentation endpoints and enhance application metadata for SBD v2
This commit is contained in:
@@ -11,14 +11,14 @@ router = APIRouter()
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
@router.get("/health")
|
||||
def health() -> HealthResponse:
|
||||
"""Health check endpoint."""
|
||||
logger.info("Health check endpoint accessed")
|
||||
return HealthResponse(status="healthy")
|
||||
|
||||
|
||||
@router.get("/scalar-docs", response_class=HTMLResponse)
|
||||
@router.get("/docs/scalar", response_class=HTMLResponse)
|
||||
def scalar_docs() -> HTMLResponse:
|
||||
"""Serve the API documentation using Scalar."""
|
||||
return """
|
||||
@@ -39,8 +39,8 @@ def scalar_docs() -> HTMLResponse:
|
||||
"""
|
||||
|
||||
|
||||
@router.get("/rapidoc-docs", response_class=HTMLResponse)
|
||||
async def rapidoc() -> HTMLResponse:
|
||||
@router.get("/docs/rapidoc", response_class=HTMLResponse)
|
||||
async def rapidoc_docs() -> HTMLResponse:
|
||||
"""Serve the API documentation using Rapidoc."""
|
||||
return """
|
||||
<!doctype html>
|
||||
@@ -61,7 +61,7 @@ async def rapidoc() -> HTMLResponse:
|
||||
"""
|
||||
|
||||
|
||||
@router.get("/elements-docs", response_class=HTMLResponse)
|
||||
@router.get("/docs/elements", response_class=HTMLResponse)
|
||||
async def elements_docs() -> HTMLResponse:
|
||||
"""Serve the API documentation using Stoplight Elements."""
|
||||
return """
|
||||
|
||||
@@ -59,12 +59,9 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
def create_app() -> FastAPI:
|
||||
"""Create and configure the FastAPI application."""
|
||||
app = FastAPI(
|
||||
title="Soundboard API",
|
||||
description=(
|
||||
"API for the Soundboard application with authentication, "
|
||||
"sound management, and real-time features"
|
||||
),
|
||||
version="1.0.0",
|
||||
title="SBD v2 API",
|
||||
description=("API for the SBD v2 application"),
|
||||
version="2.0.0",
|
||||
lifespan=lifespan,
|
||||
# Configure docs URLs for reverse proxy setup
|
||||
docs_url="/api/docs", # Swagger UI at /api/docs
|
||||
|
||||
Reference in New Issue
Block a user