From ec006132027a83c6abf8d128c78c2a9c778ae02d Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Thu, 29 Oct 2020 02:07:25 +0100 Subject: [PATCH] feat(httpd): add new healthz endpoint Signed-off-by: Mark Sagi-Kazar --- httpd/router.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/httpd/router.go b/httpd/router.go index 92a1a4a2..e5839fb2 100644 --- a/httpd/router.go +++ b/httpd/router.go @@ -23,6 +23,12 @@ func GetHTTPRouter() http.Handler { func initializeRouter(staticFilesPath string, enableProfiler, enableWebAdmin bool) { router = chi.NewRouter() + router.Group(func(r chi.Router) { + r.Get("/healthz", func(w http.ResponseWriter, r *http.Request) { + render.PlainText(w, r, "ok") + }) + }) + router.Group(func(router chi.Router) { router.Use(middleware.RequestID) router.Use(middleware.RealIP)