Automated Action f047098f40 Create FastAPI REST API with SQLite database
- 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)
2025-05-14 01:20:38 +00:00

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