Closed
Description
Description
Can add NoRoute(h HandlerFunc, m ...MiddlewareFunc) to Group and Echo?
There are NoRoute() in https://github.com/gin-gonic/gin.
NoRoute() usage:
package mai
func main() {
engine := echo.New()
engine.Use(middleware.Logger())
engine.Use(middleware.Recover())
engine.NoRoute(http.DefaultServeMux)
q := engine.Group("/query")
q.GET("/hello", func(ctx echo.Context) error {
ctx.String(http.StatusOK "hi!")
})
q.NoRoute(func(ctx echo.Context) error {
ctx.String(http.StatusNotFound, "not found with prefix is /query")
})
}