added: exclude routes

This commit is contained in:
nquidox 2025-07-07 17:48:36 +03:00
parent 0a53ac2974
commit 2028671a54
2 changed files with 11 additions and 1 deletions

View file

@ -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
}