📜  快速请求路径 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:01.857000             🧑  作者: Mango

代码示例3
// send the rendered view to the client
res.render('index')

// if a callback is specified, the rendered HTML string has to be sent explicitly
res.render('index', function (err, html) {
  res.send(html)
})

// pass a local variable to the view
res.render('user', { name: 'Tobi' }, function (err, html) {
  // ...
})