我将我的应用程序部署到 Heroku。这是一个 node.js + express + socket.io 应用程序,这是 package.json
文件
{
"name": "game_test",
"author": "Ilya",
"description": "A test app for our board game",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "3.0.6",
"jade": "*",
"socket.io" : "*"
},
"engines": {
"node": "0.8.14"
}
}
这是我得到的日志:
heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=game-test-1.herokuapp.com fwd=37.26.146.185 dyno= queue= wait= connect= service= status=503 bytes=
heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=game-test-1.herokuapp.com fwd=37.26.146.185 dyno= queue= wait= connect= service= status=503 bytes=
这是什么意思?
原文由 ilyo 发布,翻译遵循 CC BY-SA 4.0 许可协议
在这里为我找到了解决方案: Heroku + node.js 错误(Web 进程在启动后 60 秒内无法绑定到 $PORT)
在我的情况下,我的应用程序崩溃了,因为我很难设置 PORT,而不是使用 heroku dinamicaly 设置的端口,可以使用
process.env.PORT
访问