🐐
This commit is contained in:
17
backend/routers/health.py
Normal file
17
backend/routers/health.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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"})
|
||||
Reference in New Issue
Block a user