Tag: baucis

Baucis + Node.js

今天是个好日子! 我对理解baucis有一些问题( https://github.com/wprl/baucis )。 在中间件部分,我发现请求可以有isAuthenticated()方法,但在文档中我没有find任何有关它的信息,并且在调用它的时候出错了。 我需要自己在我的代码中实现这个方法吗? 我的代码: var citySchema = new mongoose.Schema({ name: String }); mongoose.model('City', citySchema); var citiesController = baucis.rest('City'); citiesController.request(function (req, res, next) { if (req.isAuthenticated()) return next(); return res.send(401); });