我这里有这段代码
var router = require('./Router/index')(app, passport);
我将app和护照传递给我的index.js文件
module.exports = function (app,passport) {
// App's API
app.use('/api', require('./Routes/AppRoute'));
// Website
app.use('/', require('./Routes/Website'));
app.use('/keys', require('./Routes/KeysRoute'));
app.use('/users', require('./Routes/UsersRoute'));
};
我将在我的网站路线文件中使用护照
var express = require('express');
var router = express.Router();
var Users = require('../../Class/Users');
router.get('/CreateUser', function (req, res) {
Users.getUsers(function(result){
res.render('NewUser');
});
});
module.exports = router;
如何将护照对象传递给我的网站路径文件?