小编roa*_*ode的帖子

格兰特 vs Passport.js?

GrantPassport.js 有什么区别?什么时候应该使用 Grant 而不是passport.js,反之亦然?

如果我想制作社交媒体并跟踪用户活动并将其发布在新闻提要上,我应该使用哪个?格兰特还是passport.js?

javascript node.js express passport.js

5
推荐指数
1
解决办法
2813
查看次数

Node.js Express 4.0 中的 res.render 回调参数的用途是什么?

回调参数的目的是什么res.render

在什么情况下,由于模板已被指定为第一个参数,因此人们会想要使用这样的回调参数?

这是文档中的代码:

// 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) {
  // ...
});
Run Code Online (Sandbox Code Playgroud)

我理解前两个论点的目的,但不明白最后一个。

javascript node.js express pug

5
推荐指数
1
解决办法
5020
查看次数

标签 统计

express ×2

javascript ×2

node.js ×2

passport.js ×1

pug ×1