MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / initializeRouter

Function initializeRouter

cmd/server.go:182–196  ·  view source on GitHub ↗
(b *ledgerforgeInstance)

Source from the content-addressed store, hash-verified

180}
181
182func initializeRouter(b *ledgerforgeInstance) *gin.Engine {
183 router := api.NewAPI(b.ledgerforge).Router()
184 router.GET("/health", healthCheckHandler)
185 if h := trace.MetricsHandler(); h != nil {
186 cfg, _ := config.Fetch()
187 var secure bool
188 var token string
189 if cfg != nil {
190 secure = cfg.Server.Secure
191 token = cfg.Server.MetricsBearerToken
192 }
193 router.GET("/metrics", middleware.MetricsAuth(secure, token), gin.WrapH(h))
194 }
195 return router
196}
197
198func initializeOpenTelemetry(ctx context.Context) (func(context.Context) error, error) {
199 shutdown, err := trace.SetupOTelSDK(ctx, "LEDGERFORGE")

Callers 1

serverCommandsFunction · 0.85

Calls 4

NewAPIFunction · 0.92
FetchFunction · 0.92
MetricsAuthFunction · 0.92
RouterMethod · 0.80

Tested by

no test coverage detected