javascript - Express.js Routing wrong route -


i have 3 express.js routes

app.get('/packages/:name', (req, res) => {...}); app.get('/packages/search/', (req, res) => {...}); app.get('/packages/search/:name', (req, res) => {...}); 

the first , thrid routes working fine. second route never triggert. when browse "localhost/packages/search/" trigger first route res.params.name = "search/"

i can "if" check if "search/" don't think thats solution.

am doing wrong?

routes in express.js executed in order.

for detail node.js express route naming , ordering: how precedence determined?


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -