package health import ( "encoding/json" "net/http" ) // HealthResponse represents the health check response type HealthResponse struct { Status string `json:"status"` } // HealthHandler handles the /health endpoint func HealthHandler(w http.ResponseWriter, r *http.Request) { // Only allow GET requests if r.Method != http.MethodGet { http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) return } response := HealthResponse{ Status: "ok", } w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) json.NewEncoder(w).Encode(response) }