Heroku node.js脚本的Procfile不在root中

时间:2021-08-20 21:59:41

My aim is to create a groupme bot using heroku and node.js https://github.com/whitec54/shouts-things

我的目标是使用heroku和node.js创建一个groupme机器人https://github.com/whitec54/shouts-things

I'm pretty new to web development so maybe this is glaring but I can't seem to fix my heroku application error.

我对Web开发很新,所以也许这很明显,但我似乎无法解决我的heroku应用程序错误。

This is the message returned by the logs:

这是日志返回的消息:

2016-07-26T01:44:52.756548+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-26T01:44:53.848661+00:00 heroku[web.1]: Starting process with command `node routes/index.js`
2016-07-26T01:44:55.966222+00:00 heroku[web.1]: Process exited with status 0
2016-07-26T01:45:09.474760+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shouts-things.herokuapp.com request_id=19173085-e8ed-4a85-8cd9-90c96b7347f6 fwd="108.178.113.130" dyno= connect= service= status=503 bytes=
2016-07-26T01:45:08.701288+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shouts-things.herokuapp.com request_id=f29fef93-7530-4c1e-9724-73884694b457 fwd="108.178.113.130" dyno= connect= service= status=503 bytes=

this error is seems better than what I started with but I'm not sure where to go from here. In spite of the reading I've done my understanding of how Procfiles work in heroku is pretty weak.

这个错误似乎比我开始时更好,但我不知道从哪里开始。尽管如此,我已经完成了对Procfiles如何在heroku中工作的理解。

1 个解决方案

#1


1  

In your Procfile it has mentioned to start routes/index.js which doesn't have any code to run the express server. You should be having this route registered on app.js and start app.js with node.

在你的Procfile中,它提到了启动routes / index.js,它没有任何代码来运行express服务器。您应该在app.js上注册此路由并使用node启动app.js.

express-generator npm will help you get started with the basic scaffolding required for a nodejs project.

express-generator npm将帮助您开始使用nodejs项目所需的基本脚手架。

#1


1  

In your Procfile it has mentioned to start routes/index.js which doesn't have any code to run the express server. You should be having this route registered on app.js and start app.js with node.

在你的Procfile中,它提到了启动routes / index.js,它没有任何代码来运行express服务器。您应该在app.js上注册此路由并使用node启动app.js.

express-generator npm will help you get started with the basic scaffolding required for a nodejs project.

express-generator npm将帮助您开始使用nodejs项目所需的基本脚手架。