出现节点API + Heroku部署问题

时间:2018-08-14 05:00:02

标签: javascript node.js reactjs heroku heroku-api

enter image description here我已经编写了Node API,并且已经在Heroku中上载了,但是当我想打开任何其他路由器时,它会向我显示一些错误,例如应用程序错误。甚至我都必须添加Procfile,但是在下面出现了应用程序错误的问题,我已经看到了“ heroku logs --tail”,我遵循相同的命令,但是在Error和H12时我得到了

有人可以帮助我吗,谢谢adv

1 个答案:

答案 0 :(得分:0)

我认为您忘记了aboutus.find()(作为对象)上的必需参数。如果您要查找所有查询,则需要在第一个参数中提供空对象,请尝试

aboutus.find({}, (err, data1) => {
            if (err) throw err;
            res.render('aboutus_edit.ejs', {
                aboutus: data1
            });
    })

参考:http://mongoosejs.com/docs/api.html#model_Model.find

相关问题