health_check

Function health_check 

Source
pub fn health_check() -> Json<HealthResponse>
Expand description

Health check endpoint.

Simple endpoint that returns 200 OK if the service is running. Does not check pool health - use readiness_check for that.

§Endpoint

GET /health

§Response (200 OK)

{
    "status": "healthy",
    "service": "html2pdf-api"
}

§Use Cases

  • Kubernetes liveness probe
  • Load balancer health check
  • Uptime monitoring

§Kubernetes Example

livenessProbe:
  httpGet:
    path: /health
    port: 8000
  initialDelaySeconds: 10
  periodSeconds: 30

§Usage in App

rocket::build()
    .mount("/", routes![health_check])