MCPcopy
hub / github.com/labstack/echo / RouteNotFound

Method RouteNotFound

echo.go:554–556  ·  view source on GitHub ↗

RouteNotFound registers a special-case route which is executed when no other route is found (i.e. HTTP 404 cases) for current request URL. Path supports static and named/any parameters just like other http method is defined. Generally path is ended with wildcard/match-any character (`/*`, `/download

(path string, h HandlerFunc, m ...MiddlewareFunc)

Source from the content-addressed store, hash-verified

552//
553// Example: `e.RouteNotFound("/*", func(c *echo.Context) error { return c.NoContent(http.StatusNotFound) })`
554func (e *Echo) RouteNotFound(path string, h HandlerFunc, m ...MiddlewareFunc) RouteInfo {
555 return e.Add(RouteNotFound, path, h, m...)
556}
557
558// Any registers a new route for all HTTP methods (supported by Echo) and path with matching handler
559// in the router with optional route-level middleware.

Calls 1

AddMethod · 0.95