[英]How do you use a variable in Express's res.redirect()?
I'm trying to do this, but it isn't working: 我正在尝试这样做,但是没有用:
res.redirect('/show/{{page.url_name}}');
This is the full route: 这是完整的路线:
router.post('/update/:url_name', function(req, res) {
Page.findOne({url_name: req.params.url_name}, function(err, page) {
page.title = req.body.title;
page.body = req.body.body;
page.save(function(err) {
res.redirect('/show/{{page.url_name}}');
});
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.