Is your feature request related to a problem?
app.Group seems impossible to nest multiple layers like gin
Describe the solution you'd like
//my api module
apiRouter := app.Group("/api")
{
authRouter := apiRouter.Group("/auth")
{
authRouter.POST("/login", auth.Login)
authRouter.GET("/tokenRefresh", middleware.JWTAuth(), auth.TokenRefresh)
}
v1Router := apiRouter.Group("/v1", middleware.JWTAuth())
{
managerRouter := v1Router.Group("/managers")
{
managerRouter.POST("", manager.Add)
}
testRouter := v1Router.Group("/test")
{
testRouter.GET("/redisSet", test.RedisSet)
}
}
v2Router := apiRouter.Group("/v2")
{
managerRouter := v2Router.Group("/manager")
{
managerRouter.POST("/add", v2manager.Add)
}
}
}
Describe alternatives you've considered
Additional context
Group chaining will be available in v2 https://github.com/gofiber/fiber/issues/92
PS: In v2 you can also provide middleware handlers to the group
func main() {
api := app.Group("/api", cors()) // /api
v1 := api.Group("/v1", mysql()) // /api/v1
v1.Get("/list", handler) // /api/v1/list
v1.Get("/user", handler) // /api/v1/user
v2 := api.Group("/v2", mongodb()) // /api/v2
v2.Get("/list", handler) // /api/v2/list
v2.Get("/user", handler) // /api/v2/user
}
Most helpful comment
Group chaining will be available in
v2https://github.com/gofiber/fiber/issues/92PS: In
v2you can also provide middleware handlers to the group