I'm working on a rest api in which I'm using middlewares and trying to set nested routes.
i got something like this:
router.use('/route/:param/day, router1);
router.use('/route/:param/year, router2);
router1.get('/:day/:month/:year', function(req, res){
...
});
The parameter refers to the type of research that I have to do into my database and I need to know the kind and the date to do the proper request.
the thing is, I would like to get the param from the parent into the nested one, I set mergeParams: true
but I cannot get it, it's always undefined.