📜  使用 ejs 在 html 页面中显示猫鼬的数据 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:04.708000             🧑  作者: Mango

代码示例1
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
        });
    });
});