
- Set up project structure with FastAPI and SQLAlchemy - Configure SQLite database with async support - Implement CRUD endpoints for items resource - Add health endpoint for monitoring - Set up Alembic migrations - Create comprehensive documentation generated with BackendIM... (backend.im)
17 lines
430 B
Python
17 lines
430 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.db.session import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("")
|
|
async def health_check(db: AsyncSession = Depends(get_db)):
|
|
"""
|
|
Health check endpoint to verify API and database connectivity.
|
|
"""
|
|
return {
|
|
"status": "healthy",
|
|
"database": "connected",
|
|
"message": "API is running correctly"
|
|
} |