18 lines
516 B
Python
18 lines
516 B
Python
from fastapi import APIRouter, Depends
|
|
from fastapi.responses import JSONResponse
|
|
from sqlalchemy.orm import Session
|
|
from sqlalchemy import text
|
|
from core.database import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/health")
|
|
def health_check(db: Session = Depends(get_db)):
|
|
# Validates that the DB is reachable, not just that the process is up
|
|
db.execute(text("SELECT 1"))
|
|
return {"status": "ok"}
|
|
|
|
@router.get("/teapot")
|
|
def teapot():
|
|
return JSONResponse(status_code=418, content={"message": "I'm a teapot"})
|