Express Router – mergeParams

I spent the last two days trying to figure out why I couldn’t access my req.params in my Express.js router middleware.  I finally figured it out!

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

I needed to add { mergeParams: true } when I call the Router.

Leave a Reply

Your email address will not be published. Required fields are marked *