From 37cd3dfa50629ce450a5be63636cf32f99b715c5 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Mon, 15 Apr 2019 10:16:49 +0100
Subject: [PATCH] Add simple healthcheck handler

---
 node/http.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/node/http.go b/node/http.go
index 006b1b8b..75cd48e8 100644
--- a/node/http.go
+++ b/node/http.go
@@ -42,6 +42,12 @@ func newHTTPHandler(n *Node, icecastPort int, domain string) http.Handler {
 		Prefix:    "static",
 	})))
 
+	// Simple healthcheck handler.
+	mux.HandleFunc("/healthcheck", func(w http.ResponseWriter, _ *http.Request) {
+		w.Header().Set("Content-Type", "text/plain")
+		io.WriteString(w, "OK") //nolint
+	})
+
 	// Serve /debug/ pages using the default HTTP handler
 	// (packages will automatically register their debug handlers
 	// there). Using command-line flags it is possible to disable
-- 
GitLab