mirror of
https://github.com/grassrootseconomics/eth-tracker.git
synced 2026-05-16 01:57:15 +02:00
release: v1.0.0-rc
This commit is contained in:
23
internal/api/api.go
Normal file
23
internal/api/api.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user