Skip to content

Commit

Permalink
update README with router.params promise info
Browse files Browse the repository at this point in the history
  • Loading branch information
jonchurch committed Apr 19, 2020
1 parent 89ff9cf commit 95aef63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ Maps the specified path parameter `name` to a specialized param-capturing middle

This function positions the middleware in the same stack as `.use`.

If a `Promise` object is returned from the `param_middleware` function, the router
will attach an `onRejected` callback using `.then`. If the promise is rejected,
`next` will be called with the rejected value, or an error if the value is falsy.

Parameter mapping is used to provide pre-conditions to routes
which use normalized placeholders. For example a _:user_id_ parameter
could automatically load a user's information from the database without
Expand Down

0 comments on commit 95aef63

Please sign in to comment.