Spaces:
Paused
Paused
Download backend/api/health.py from Sahil-nith/SatQuery-api: direct link, hf CLI and curl.
- Browser
- Download file 724 Bytes
-
https://huggingface.co/spaces/Sahil-nith/SatQuery-api/resolve/main/backend/api/health.py
- Command line
-
hf download hf://spaces/Sahil-nith/SatQuery-api/backend/api/health.py
-
curl -L -o health.py https://huggingface.co/spaces/Sahil-nith/SatQuery-api/resolve/main/backend/api/health.py
724 Bytes
| """ | |
| GET /api/health | |
| Simple liveness endpoint used to verify the frontend <-> backend | |
| connection during Milestone 1. Expand later with subsystem checks | |
| (model registry loaded? GDAL available?) but keep it fast and boring — | |
| this gets polled by the UI status dot. | |
| """ | |
| from datetime import datetime, timezone | |
| from fastapi import APIRouter | |
| from pydantic import BaseModel | |
| router = APIRouter() | |
| class HealthResponse(BaseModel): | |
| status: str | |
| service: str | |
| timestamp: str | |
| def health_check() -> HealthResponse: | |
| return HealthResponse( | |
| status="ok", | |
| service="satquery-ai-backend", | |
| timestamp=datetime.now(timezone.utc).isoformat(), | |
| ) | |