Store matched routes in request by ajfranzoia · Pull Request #34 · pillarjs/router
haysmike pushed a commit to goodeggs/secure-router that referenced this pull request
- set `__mountpath` in `.use()` - override `process_params` to add `req.matchedRoutes` `req.matchedRoutes` is a proposed addition to express v5: pillarjs/router#34 Doing this because in goodeggs-stats, we need to know what route we are currently on when we are publishing metrics to librato. In express v4 there is no mechanism to do this, if the routes have parameters in them (like :id, etc) or if they have nesting (given /foo/bar, the middleware for /foo has no knowledge of /bar and vice-versa).