From cc8974d6b7347ef13c6cc1780e972f4becfb2e82 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 28 Jun 2026 15:54:58 +0200 Subject: [PATCH] Add health check endpoint at /ok - Returns {"status": "ok"} as JSON - No authentication required - Useful for Kubernetes liveness/readiness probes Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 98215cb..e57c0d7 100644 --- a/main.go +++ b/main.go @@ -193,6 +193,11 @@ func vectorHandler(w http.ResponseWriter, r *http.Request) { }) } +func healthHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(map[string]string{"status": "ok"}) +} + func main() { port := os.Getenv("PORT") if port == "" { @@ -200,6 +205,7 @@ func main() { } http.HandleFunc("/vector", vectorHandler) + http.HandleFunc("/ok", healthHandler) log.Printf("Starting server on port %s...\n", port) log.Fatal(http.ListenAndServe(":"+port, nil)) }