package api import ( "encoding/json" "net/http" ) type HealthResponse struct { Status string `json:"status"` } func (s *Server) handleHealth( w http.ResponseWriter, r *http.Request, ) { w.Header().Set("Content-Type", "application/json") response := HealthResponse{ Status: "ok", } if err := json.NewEncoder(w).Encode(response); err != nil { writeError(w, http.StatusInternalServerError, "failed to encode response") } }