mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2025-02-22 16:00:37 +01:00
24 lines
392 B
Go
24 lines
392 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/VictoriaMetrics/metrics"
|
|
"github.com/uptrace/bunrouter"
|
|
)
|
|
|
|
func New() *bunrouter.Router {
|
|
router := bunrouter.New()
|
|
|
|
router.GET("/metrics", metricsHandler())
|
|
|
|
return router
|
|
}
|
|
|
|
func metricsHandler() bunrouter.HandlerFunc {
|
|
return func(w http.ResponseWriter, _ bunrouter.Request) error {
|
|
metrics.WritePrometheus(w, true)
|
|
return nil
|
|
}
|
|
}
|