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

Method Pre

echo.go:483–486  ·  view source on GitHub ↗

Pre adds middleware to the chain which is run before router tries to find matching route. Meaning middleware is executed even for 404 (not found) cases.

(middleware ...MiddlewareFunc)

Source from the content-addressed store, hash-verified

481// Pre adds middleware to the chain which is run before router tries to find matching route.
482// Meaning middleware is executed even for 404 (not found) cases.
483func (e *Echo) Pre(middleware ...MiddlewareFunc) {
484 e.premiddleware = append(e.premiddleware, middleware...)
485 e.buildRouterChains()
486}
487
488// Use adds middleware to the chain which is run after router has found matching route and before route/request handler method is executed.
489func (e *Echo) Use(middleware ...MiddlewareFunc) {

Calls 1

buildRouterChainsMethod · 0.95