@mytec: 1.1iter ready for testing
This commit is contained in:
18
backend/app/api/routes/health.py
Normal file
18
backend/app/api/routes/health.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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)}
|
||||
Reference in New Issue
Block a user