Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

pass url params to child router express

In order to pass URL params to a nested router add "{ mergeParams: true }" 
to the initialization of the nested router. Example:
// We need to merge params to make userId available in our Items router
const items = require('express').Router({ mergeParams: true });
 
PREVIOUS NEXT
Tagged: #pass #url #params #child #router #express
ADD COMMENT
Topic
Name
3+1 =