Routes.js includes the following lines of code:
X = {};
X.xFunction(user) {
// some code here
// console.log(user.Name);
}
var Router_Functions = require('/Router_Functions');
app.get('/', Router_Functions.aFunction)
Router_Functions.js
exports.afunction = function (req, res) {
xFunction(req.session.user);
}
Here, error is xFunction
is undefined. But in such case, how do you to pass function X.xFunction()
from 'routes.js' to 'Router_Functions.js'