diff --git a/README.md b/README.md index a498379..ddcdb81 100644 --- a/README.md +++ b/README.md @@ -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