mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
move metrics to /metrics.
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/go-chi/cors"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
@ -41,6 +42,11 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
|
||||
return config.AllowOrigin(r.Header.Get("Origin"))
|
||||
}))
|
||||
|
||||
router.Get("/metrics", func(w http.ResponseWriter, r *http.Request) error {
|
||||
promhttp.Handler().ServeHTTP(w, r)
|
||||
return nil
|
||||
})
|
||||
|
||||
if config.Static != "" {
|
||||
fs := http.FileServer(http.Dir(config.Static))
|
||||
router.Get("/*", func(w http.ResponseWriter, r *http.Request) error {
|
||||
|
Reference in New Issue
Block a user