mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Add option to enable maintenance mode
This commit is contained in:
parent
a8de067810
commit
df7a6e18fd
5 changed files with 37 additions and 1 deletions
|
@ -169,6 +169,14 @@ func setupHandler(store *storage.Storage, feedHandler *feed.Handler, pool *worke
|
|||
router = router.PathPrefix(config.Opts.BasePath()).Subrouter()
|
||||
}
|
||||
|
||||
if config.Opts.HasMaintenanceMode() {
|
||||
router.Use(func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte(config.Opts.MaintenanceMessage()))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
router.Use(middleware)
|
||||
|
||||
fever.Serve(router, store)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue