如何解决heroku应用上的错误

时间:2019-07-13 01:47:09

标签: node.js mongodb heroku

我已经使用node.js作为服务器并使用mongoDB编写了一个应用程序。在本地使用时,它工作正常,并且部署说成功,但是当我打开应用程序时,它因错误而崩溃了。

我曾尝试在heroku上为mongoURI和jwtSecret设置config vars,但似乎无法解决问题,因为它说mongoURI未定义。

这是heroku日志的示例

Error: Configuration property "mongoURI" is not defined
2019-07-12T14:13:27.306966+00:00 app[web.1]: at Config.get (/app/node_modules/config/lib/config.js:203:11)
2019-07-12T14:13:27.306968+00:00 app[web.1]: at Object.<anonymous> (/app/server.js:11:19)
2019-07-12T14:13:27.319772+00:00 app[web.1]: npm ERR! shopping-list@1.0.0 start: `node server.js`
2019-07-12T14:13:27.320564+00:00 app[web.1]: npm ERR! Failed at the shopping-list@1.0.0 start script.
2019-07-12T14:13:27.320788+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-07-12T19:55:27.399289+00:00 app[web.1]: WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
No configurations found in configuration directory:/app/config

2019-07-13T01:26:07.013405+00:00 app[api]: Set mongoURI config vars by user

2019-07-13T01:29:40.779826+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" 

在此处链接到git代码:

https://github.com/LeighS95/shopping-list

0 个答案:

没有答案
相关问题