소스 검색

feat(httpd): add new healthz endpoint

Signed-off-by: Mark Sagi-Kazar <[email protected]>
Mark Sagi-Kazar 5 년 전
부모
커밋
ec00613202
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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) {
 func initializeRouter(staticFilesPath string, enableProfiler, enableWebAdmin bool) {
 	router = chi.NewRouter()
 	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.Group(func(router chi.Router) {
 		router.Use(middleware.RequestID)
 		router.Use(middleware.RequestID)
 		router.Use(middleware.RealIP)
 		router.Use(middleware.RealIP)