Route protected


Hello Mrs,

I am using JWT midleware in my Echo application, in JAVA with Spring, we can annotate a routes with @role=“ADMIN”, Spring automatically validates if the logged in user has access in the area that he has accessed.

Here in the Go world with Echo, is it possible to protect routes by permission level? Or should we implement this in each handler (controller)?

Sorry for English.


We don’t have annotations like Java, however, middleware framework in Echo is very flexible - you can have middleware for root level, group level or individual handler. You can also leverage Skipper function to conditionally skip any route.