From f0adf3a3563ff6958e4137b0b27962bd9c5a7799 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Thu, 17 Oct 2024 10:05:49 +0300 Subject: [PATCH] Health check is empty JSON, 200 OK --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 346494c..3021276 100644 --- a/main.go +++ b/main.go @@ -59,8 +59,9 @@ func readConfig(filePath string) Config { // Start the health check func startHealthCheckServer(port int, endpoint string) { http.HandleFunc(endpoint, func(w http.ResponseWriter, r *http.Request) { + // If the server is healthy, the response if 200 OK json, no content + w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write([]byte("Jilo Server is running")) }) address := fmt.Sprintf(":%d", port)