-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested routers are not handled? #3
Comments
Can you give me an example of nested routers. You can pass each router as additional params i.e. |
You can mount apps to each other in Express 4, so I guess I would have to extract all of them. |
It's been a year since I touched this 😟, I will have to have a look at the router and see how and/or if they include reference to mounted expresses. Can you share some snippets of how you have them mounted so I can replicate exactly ? |
Sure you can find it in documentation too: var express = require('express');
var expressListRoutes = require('express-list-routes');
var app = express(); // the main app
var admin = express(); // the sub app
app.get('/', function (req, res) {
res.send('Index Homepage');
});
admin.get('/', function (req, res) {
console.log(admin.mountpath); // /admin
res.send('Admin Homepage');
});
app.use('/admin', admin); // mount the sub app
// expecting it to print the whole hierarchy
expressListRoutes(app._router); I skimmed through but I couldn't find any way to actually enumerate linked apps. I think we would have to use private properties to achieve this. |
Great, thank you, I'll look into it. I can't promise to have anything soon for this though :( In the meantime you can do this |
Sure, not critical.
|
Just hit this myself, and spent a while trying to work out why my routers weren't working correctly before thinking to actually try it with cURL and see... |
It does not seem to handle nested routers.
The text was updated successfully, but these errors were encountered: