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)
| 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. |
| 483 | func (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. |
| 489 | func (e *Echo) Use(middleware ...MiddlewareFunc) { |