feat(httpd): add new healthz endpoint

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar 2020-10-29 02:07:25 +01:00 committed by Nicola Murino
parent 02ec3a5f48
commit ec00613202

View file

@ -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)