Skip to content

Commit

Permalink
Merge pull request #4 from mogui/master
Browse files Browse the repository at this point in the history
Extract routes from middlewere installed Router
  • Loading branch information
nabeel-ahmad committed Oct 30, 2014
2 parents 31a7658 + 7ee6ca4 commit 4ef0ac9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Expand Up @@ -18,6 +18,14 @@ module.exports = function (app, mongoose) {
if (!_.isUndefined(route.route)) {
route.route.method = Object.keys(route.route.methods).toString();
arr.push(route.route);
} else if(route.handle.stack) {
// Extract routes from middlewere installed Router
_.each(route.handle.stack, function (route) {
if (!_.isUndefined(route.route)) {
route.route.method = Object.keys(route.route.methods).toString();
arr.push(route.route);
}
});
}
});
routes = arr;
Expand Down

0 comments on commit 4ef0ac9

Please sign in to comment.