diff --git a/.gitignore b/.gitignore index cdf07118..a29d1cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -TestResults-* \ No newline at end of file +TestResults-* +.env +*.env +*.env.* \ No newline at end of file diff --git a/main.go b/main.go index 65f7f4d3..640fc207 100644 --- a/main.go +++ b/main.go @@ -54,6 +54,18 @@ func main() { http.ServeFile(w, r, "./static/index.html") }) + r.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + // Set the content type to application/json + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + + // Define a health check response structure + response := map[string]string{"status": "healthy"} + + // Encode the response as JSON and send it + json.NewEncoder(w).Encode(response) + }) + // Serve all static files from the "static" directory staticFileDirectory := http.Dir("./static") staticFileHandler := http.StripPrefix("/static/", http.FileServer(staticFileDirectory))