Cleaner and non-deprecated typing for template app module. Avoids ruff errors with strict configurations.

This commit is contained in:
2026-08-31 20:14:39 +00:00
parent 8774224545
commit 475a2cdc3c
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
"""FastAPI application module with Vue frontend integration."""
from collections.abc import AsyncIterator
from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from pathlib import Path
@@ -13,7 +13,7 @@ frontend = Frontend(Path(__file__).with_name("frontend-build"))
@asynccontextmanager
async def lifespan(_app: FastAPI) -> AsyncIterator[None]:
async def lifespan(_app: FastAPI) -> AsyncGenerator:
"""Manage app startup and shutdown resources."""
await frontend.load()
yield
@@ -27,7 +27,7 @@ app = FastAPI(title="PROJECT_TITLE", debug=DEVMODE, lifespan=lifespan)
# Health check endpoint for the Vue demo app to verify the backend is running
@app.get("/api/health")
async def health_check() -> dict[str, str]:
async def health_check() -> dict:
"""Return backend status for health monitoring."""
return {"status": "ok"}