19 lines
455 B
Python
19 lines
455 B
Python
from fastapi import APIRouter, Depends
|
|
from app.api.deps import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/")
|
|
async def health_check():
|
|
return {"status": "ok", "service": "rfcp-backend", "version": "1.1.0"}
|
|
|
|
|
|
@router.get("/db")
|
|
async def db_check(db=Depends(get_db)):
|
|
try:
|
|
await db.command("ping")
|
|
return {"status": "ok", "database": "connected"}
|
|
except Exception as e:
|
|
return {"status": "error", "database": str(e)}
|