added: exclude routes
This commit is contained in:
parent
0a53ac2974
commit
2028671a54
2 changed files with 11 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"merch-parser-api/internal/interfaces"
|
||||
"merch-parser-api/internal/shared"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -40,12 +41,17 @@ func NewApp(deps Deps) *App {
|
|||
c.String(http.StatusOK, "API is ready")
|
||||
})
|
||||
|
||||
var excludeRoutes []shared.ExcludeRoute
|
||||
|
||||
for _, m := range app.modules {
|
||||
if hasRoutes, ok := m.(interfaces.ModuleRoutes); ok {
|
||||
hasRoutes.RegisterRoutes(apiRoutes)
|
||||
excludeRoutes = append(excludeRoutes, hasRoutes.ExcludeRoutes()...)
|
||||
}
|
||||
}
|
||||
|
||||
app.routerHandler.ExcludeRoutes(excludeRoutes)
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue