This commit is contained in:
parent
88b1e03d00
commit
35944371f7
3 changed files with 8 additions and 0 deletions
|
|
@ -47,6 +47,7 @@ func NewApp(deps Deps) *App {
|
|||
}
|
||||
|
||||
app.router = app.routerHandler.Set()
|
||||
app.routerHandler.EnableMetrics()
|
||||
apiRoutes := app.router.Group(app.apiPrefix)
|
||||
|
||||
apiRoutes.GET("/", func(c *gin.Context) {
|
||||
|
|
|
|||
|
|
@ -8,4 +8,5 @@ type Router interface {
|
|||
Set() *gin.Engine
|
||||
AuthMW() gin.HandlerFunc
|
||||
RefreshMW() gin.HandlerFunc
|
||||
EnableMetrics()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
log "github.com/sirupsen/logrus"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
ginprometheus "github.com/zsais/go-gin-prometheus"
|
||||
"merch-parser-api/internal/interfaces"
|
||||
"net/http"
|
||||
"time"
|
||||
|
|
@ -73,3 +74,8 @@ func (r *router) Set() *gin.Engine {
|
|||
|
||||
return r.engine
|
||||
}
|
||||
|
||||
func (r *router) EnableMetrics() {
|
||||
p := ginprometheus.NewPrometheus("gin")
|
||||
p.Use(r.engine)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue