Move healthcheck endpoint from ui package to httpd service
This commit is contained in:
parent
56efd2eb3f
commit
a9fad093e6
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
|
4
ui/ui.go
4
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: /"))
|
||||
|
|
Loading…
Add table
Reference in a new issue