19 lines
422 B
Python
19 lines
422 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy import text
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.db.session import get_db
|
|
|
|
router = APIRouter(tags=["health"])
|
|
|
|
|
|
@router.get("/health")
|
|
def health():
|
|
return {"status": "ok", "service": "nalati-rag-api"}
|
|
|
|
|
|
@router.get("/ready")
|
|
def ready(db: Session = Depends(get_db)):
|
|
db.execute(text("SELECT 1"))
|
|
return {"status": "ok", "database": "connected"}
|