Reputation: 5477
I have a username JSON object which is being stored in as "bootstrappedUser". It is only defined on successful login. How would I make this available to the view (embed this object into the html source code) in ejs if it is defined?
app.get('/', function(req, res) {
res.render('index.ejs',{
bootstrappedUser: req.user
});
});
Upvotes: 0
Views: 72
Reputation: 104775
You can access this in EJS via:
<div>
<%= bootstrappedUser %>
</div>
Upvotes: 3