Mostrar datos de Mongoose en la página HTML utilizando EJS
app.get('/profileface', isLoggedIn, function(req, res) {
// mongoose operations are asynchronous, so you need to wait
PracticeModel.find({}, function(err, data) {
// note that data is an array of objects, not a single object!
res.render('profileface.ejs', {
user : req.user,
practices: data
});
});
});
Poor Panther