Group route does not work without leading slash
I ran into an unexpected behavior with grouped routes.
g := e.Group("/v1")
g.GET("posts", handler)
Requesting:
returns:
Changing it to:
works as expected.
I would expect Echo to handle the missing leading / when combining the group prefix and route path, or at least provide a warning during route registration.
It would be nice if both forms resulted in /v1/posts:
g.GET("posts", handler)
g.GET("/posts", handler)
Because it is very normal for a developer to not provide the slash since a group already means it's under that group (so slash should come automatically)
Otherwise its too confusing and something to forget easily when using the framework!!
Group route does not work without leading slash
I ran into an unexpected behavior with grouped routes.
Requesting:
returns:
Changing it to:
works as expected.
I would expect Echo to handle the missing leading
/when combining the group prefix and route path, or at least provide a warning during route registration.It would be nice if both forms resulted in
/v1/posts:Because it is very normal for a developer to not provide the slash since a group already means it's under that group (so slash should come automatically)
Otherwise its too confusing and something to forget easily when using the framework!!