2016-07-26 80 views
0

我的目標是使用Heroku的創建GroupMe的機器人和Node.js的https://github.com/whitec54/shouts-things的Heroku的Node.js Procfile腳本沒有根

我很新的Web開發,所以也許這是明顯的,但我不能似乎解決了我的heroku應用程序錯誤。

這是日誌返回的消息:

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= 

這個錯誤似乎比什麼我開始用更好,但我不知道在哪裏可以從這裏走。儘管閱讀過,我已經完成了對Procfiles在heroku中的工作方式的理解,但相當薄弱。

回答

1

在你的Procfile它已經提到開始routes/index.js,它沒有任何代碼來運行express服務器。您應該在app.js上註冊此路由,並使用節點啓動app.js。

express-generator npm將幫助您開始使用nodejs項目所需的基本腳手架。

+0

這是否意味着我應該爲app.js聲明一個web進程類型,因爲我正在調用路由器來處理其中的請求?此外,我是否只提到調用其他腳本的腳本,而不需要包含由另一個腳本調用的腳本? –