health.go 475 B

1234567891011121314151617181920
  1. package handler
  2. import (
  3. "net/http"
  4. )
  5. // HealthHandler handles health check requests
  6. type HealthHandler struct{}
  7. // NewHealthHandler creates a new health handler
  8. func NewHealthHandler() *HealthHandler {
  9. return &HealthHandler{}
  10. }
  11. // Handle processes health check requests
  12. func (h *HealthHandler) Handle(w http.ResponseWriter, r *http.Request) {
  13. w.Header().Set("Content-Type", "application/json")
  14. w.WriteHeader(http.StatusOK)
  15. w.Write([]byte(`{"status":"healthy"}`))
  16. }