The Grottocenter API provides a health check endpoint that allows monitoring the status of the API and its dependencies.
GET /api/v1/health
The endpoint returns a JSON object with the following structure:
{
"status": "healthy|unhealthy",
"timestamp": "2025-11-18T16:06:06.271Z",
"services": {
"database": {
"status": "healthy|unhealthy",
"message": "Database connection successful"
},
"search": {
"status": "healthy|unhealthy",
"message": "Search connection successful"
}
},
"build": {
"gitCommit": "5dc84f50a0987f7e2c58841a0199983933252dc9",
"buildTime": "2025-11-13T18:55:39.021Z"
}
}- 200 OK: All services are healthy
- 503 Service Unavailable: One or more services are unhealthy
status: Overall health status (healthyorunhealthy)timestamp: ISO 8601 timestamp when the health check was performedservices: Object containing the health status of individual servicesbuild: Object containing build information
database: PostgreSQL database connection statussearch: Typesense connection status
Each service contains:
status: Service-specific health status (healthyorunhealthy)message: Human-readable message describing the service status
gitCommit: Git commit hash of the current deployment (generated at build time)buildTime: Timestamp when the current build was generated
curl http://localhost:1337/api/v1/healthcurl -s -o /dev/null -w "%{http_code}" http://localhost:1337/api/v1/healthcurl -s http://localhost:1337/api/v1/health | jq .This endpoint is designed to be used with monitoring systems like:
- Kubernetes liveness/readiness probes
- Load balancer health checks
- Application monitoring tools (Prometheus, Datadog, etc.)
- CI/CD pipeline health verification
- The endpoint is publicly accessible (no authentication required)
- Database health is checked using a simple
SELECT 1query - Typesense health uses the built-in health endpoint
- Build information (git commit hash and build time) is generated at build time and stored in
build-info.json - Git commit hash is captured during CI/CD using
git logorGITHUB_SHAenvironment variable - If any service is unhealthy, the overall status becomes
unhealthyand HTTP 503 is returned