Explorar o código

feat(httpd): add new healthz endpoint

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
Mark Sagi-Kazar %!s(int64=4) %!d(string=hai) anos
pai
achega
ec00613202
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      httpd/router.go

+ 6 - 0
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)