package handlers import ( "encoding/json" "net/http" "time" ) type HealthResponse struct { Status string `json:"status"` Service string `json:"service"` Version string `json:"version"` Timestamp string `json:"timestamp"` } // Health returns a basic liveness handler for GET /api/v1/health. func Health(version string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodGet { http.Error(w, "method not allowed", http.StatusMethodNotAllowed) return } resp := HealthResponse{ Status: "ok", Service: "forge-mesh-server", Version: version, Timestamp: time.Now().UTC().Format(time.RFC3339), } w.Header().Set("Content-Type", "application/json") _ = json.NewEncoder(w).Encode(resp) } }