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
Post a Comment