diff options
author | Frédéric Guillot <fred@miniflux.net> | 2018-12-28 13:41:26 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-12-28 13:41:26 -0800 |
commit | a9fad093e6383c21a45de069795a77f2cab9c318 (patch) | |
tree | e8eb4cb2918ebdcea5a0236db2d689ab713a8511 | |
parent | 56efd2eb3f554b590fad8bebc4a1d752b66e5363 (diff) |
Move healthcheck endpoint from ui package to httpd service
-rw-r--r-- | service/httpd/httpd.go | 4 | ||||
-rw-r--r-- | ui/ui.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/service/httpd/httpd.go b/service/httpd/httpd.go index 612418d..2e93086 100644 --- a/service/httpd/httpd.go +++ b/service/httpd/httpd.go @@ -169,5 +169,9 @@ func setupHandler(cfg *config.Config, store *storage.Storage, feedHandler *feed. api.Serve(router, store, feedHandler) ui.Serve(router, cfg, store, pool, feedHandler) + router.HandleFunc("/healthcheck", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("OK")) + }).Name("healthcheck") + return router } @@ -124,10 +124,6 @@ func Serve(router *mux.Router, cfg *config.Config, store *storage.Storage, pool uiRouter.HandleFunc("/logout", handler.logout).Name("logout").Methods("GET") uiRouter.HandleFunc("/", handler.showLoginPage).Name("login").Methods("GET") - router.HandleFunc("/healthcheck", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("OK")) - }).Name("healthcheck") - router.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") w.Write([]byte("User-agent: *\nDisallow: /")) |