I'm new to expression and pretty confused about how I should access data on the interface side,
I have the following code
exports.init = function(req, res){ if (req.isAuthenticated()) { //res.send(); var userId = req.user._id res.render('account/usernotes'); } else { res.render('signup/index', { oauthMessage: '', oauthTwitter: !!req.app.config.oauth.twitter.key, oauthFacebook: !!req.app.config.oauth.facebook.key, oauthGoogle: !!req.app.config.oauth.google.key }); } };
I want to send UserId to the view so that I can access it so that I can receive data using it, but still use send (); displays the data value in the interface, so how do I access it. I guess
res.render('account/usernotes',req.user._id);
should work, but how do I access the data after that?
source share