_includes/api/en/5x/routing-args.html
| Argument | Description | Default |
|---|---|---|
path | The path for which the middleware function is invoked. It can be any of the following: |
For examples, see Path examples. | '/' (root path) |
| callback | One or more callback functions. Accepted formats:
You may provide multiple callbacks that behave like middleware. These can call next('route') to skip remaining callbacks for the current route. This is useful for conditional routing logic.
If a callback throws an error or returns a rejected promise, next(err) is invoked automatically.
Since both router and app implement the middleware interface, they can also be used as callback middleware.
For examples, see Middleware callback function examples.
| None |