fix: metrics were not working

This commit is contained in:
Agustin Mendez 2021-01-31 23:45:32 -03:00 committed by GitHub
parent e369484e5f
commit b0b0ab574d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,10 +60,10 @@ func CreateRouter(cfg *config.Config) *mux.Router {
router.HandleFunc("/api/v1/statuses/{key}", secureIfNecessary(cfg, GzipHandlerFunc(serviceStatusHandler))).Methods("GET")
router.HandleFunc("/api/v1/badges/uptime/{duration}/{identifier}", badgeHandler).Methods("GET")
router.HandleFunc("/health", healthHandler).Methods("GET")
router.PathPrefix("/").Handler(GzipHandler(http.FileServer(http.Dir("./web/static"))))
if cfg.Metrics {
router.Handle("/metrics", promhttp.Handler()).Methods("GET")
}
router.PathPrefix("/").Handler(GzipHandler(http.FileServer(http.Dir("./web/static"))))
return router
}