1
0
Fork 0

Update Middleware.md (#3299)

Just a sentence correction that will help readers in understanding it more clearly.
This commit is contained in:
rgrvontela 2017-09-25 10:18:38 -04:00 committed by Frank Celler
parent 8e3651283b
commit 748a3f2a47
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ Middleware
Middleware in Foxx refers to functions that can be mounted like routes and can manipulate the request and response objects before and after the route itself is invoked. They can also be used to control access or to provide common logic like logging etc. Unlike routes, middleware is mounted with the `use` method like a router.
Instead of a function the `use` method can also accept an object with a `register` function that will be passed the endpoint the middleware will be mounted at and returns the actual middleware function. This allows manipulating the endpoint before creating the middleware (e.g. to document headers, request bodies, path parameters or query parameters).
Instead of a function the `use` method can also accept an object with a `register` function that will take a parameter `endpoint`, the middleware will be mounted at and returns the actual middleware function. This allows manipulating the endpoint before creating the middleware (e.g. to document headers, request bodies, path parameters or query parameters).
**Examples**