maintenance/maintenance.go
func (s Service) HTMLHandler(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		on, err := s.store.Status()
		if err != nil {
			s.logger.Errorf("maintenance status: %v", err)
		}
		if on || err != nil {
			if s.HTML.Handler != nil {
				s.HTML.Handler.ServeHTTP(w, r)
				return
			}
			w.Header().Set("Content-Type", HTMLContentType)
			w.WriteHeader(http.StatusServiceUnavailable)
			fmt.Fprintln(w, s.HTML.Body)
			return
		}
		h.ServeHTTP(w, r)
	})
}
func (s Service) HTMLHandler(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		on, err := s.store.Status()
		if err != nil {
			s.logger.Errorf("maintenance status: %v", err)
		}
		if on || err != nil {
			if s.HTML.Handler != nil {
				s.HTML.Handler.ServeHTTP(w, r)
				return
			}
			w.Header().Set("Content-Type", HTMLContentType)
			w.WriteHeader(http.StatusServiceUnavailable)
			fmt.Fprintln(w, s.HTML.Body)
			return
		}
		h.ServeHTTP(w, r)
	})
}
// HTMLHandler is a HTTP middleware that should be used
// alongide HTML pages.