我第一次使用Node.js/express路由,使用引數時無法匹配
<a href="/produtos/1/produto-test">
app.use('/produtos', produtosRouter);
//below the produtosRouter, function
router.get('/', function(req, res, next) {
res.render('produtos/:id/:slug', { title: 'test test.' });
});
uj5u.com熱心網友回復:
這有幫助嗎?
router.get('/:id/:slug', function(req, res, next){
res.render('<name_of_the_template>', { title: 'test test.'});
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/380254.html
