aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-12-28 13:41:26 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-12-28 13:41:26 -0800
commita9fad093e6383c21a45de069795a77f2cab9c318 (patch)
treee8eb4cb2918ebdcea5a0236db2d689ab713a8511
parent56efd2eb3f554b590fad8bebc4a1d752b66e5363 (diff)
Move healthcheck endpoint from ui package to httpd service
-rw-r--r--service/httpd/httpd.go4
-rw-r--r--ui/ui.go4
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
}
diff --git a/ui/ui.go b/ui/ui.go
index 23440e7..91d4783 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -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: /"))