mirror of
https://github.com/grassrootseconomics/cic-chain-events.git
synced 2024-11-22 23:56:46 +01:00
25 lines
469 B
Go
25 lines
469 B
Go
package main
|
|
|
|
import (
|
|
"github.com/VictoriaMetrics/metrics"
|
|
"github.com/grassrootseconomics/cic-chain-events/pkg/echopprof"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func initApiServer() *echo.Echo {
|
|
server := echo.New()
|
|
server.HideBanner = true
|
|
server.HidePort = true
|
|
|
|
if ko.Bool("metrics.go_process") {
|
|
server.GET("/metrics", func(c echo.Context) error {
|
|
metrics.WritePrometheus(c.Response(), true)
|
|
return nil
|
|
})
|
|
}
|
|
|
|
echopprof.Wrap(server)
|
|
|
|
return server
|
|
}
|