I use the expression " Router in a web application. I add routers in the usual way:
app.use(router, '/myroutehere/');
The handlers for each router have no idea where they were "installed" (different files, different problems, etc.). So far, this worked fine, that I need to create a ToC for one of the routers (and the content is dynamically generated). I use url.resolve to handle relative paths, but I miss the initial part of the url (otherwise the links will be resolved to / instead of /myrouter/ ).
Is there a way to find out how to mount a router without hard coding in different places?
router.get('/', function(req, res){
source share