Lab4: S3 attachments (grade 3)

This commit is contained in:
2026-11-16 22:14:58 +03:00
parent ec540a1a72
commit 2087336dad
29 changed files with 1084 additions and 31 deletions
+19
View File
@@ -0,0 +1,19 @@
from fastapi import APIRouter, Depends
from sqlalchemy import text
from sqlalchemy.orm import Session
from ..db import get_db
from ..errors import ApiError
router = APIRouter(prefix="/health", tags=["health"])
@router.get("/live")
def live():
return {"status": "ok"}
@router.get("/ready")
def ready(db: Session = Depends(get_db)):
try:
db.execute(text("SELECT 1"))
except Exception:
raise ApiError(503, "unavailable", "database unavailable")
return {"status": "ok"}