Express Router undefined params with router.use when split across files Express Router undefined params with router.use when split across files express express

Express Router undefined params with router.use when split across files


When you create your Router in File 2, you need to tell it to inherit params from parents.

var router = express.Router({mergeParams: true});

http://expressjs.com/api.html#router