我有一个在localhost上开发的服务器,我认为Heroku是上线的好垫脚石。不幸的是,我无法正常工作。
更具体地说,我可以让Heroku构建得足够好,但是当我尝试访问我的网站时,它就会崩溃。
Heroku日志如下:
2019-06-30T18:34:04.000000+00:00 app[api]: Build started by user tomdothosker@gmail.com
2019-06-30T18:34:24.381150+00:00 app[api]: Deploy 7f8cce5d by user tomdothosker@gmail.com
2019-06-30T18:34:24.381150+00:00 app[api]: Release v17 created by user tomdothosker@gmail.com
2019-06-30T18:34:25.000000+00:00 app[api]: Build succeeded
2019-06-30T18:34:25.695607+00:00 heroku[web.1]: Restarting
2019-06-30T18:34:26.034203+00:00 heroku[web.1]: State changed from up to starting
2019-06-30T18:34:26.966179+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2019-06-30T18:34:27.034914+00:00 heroku[web.1]: Process exited with status 143
2019-06-30T18:34:29.568812+00:00 heroku[web.1]: Starting process with command `npm start`
2019-06-30T18:34:32.418305+00:00 app[web.1]:
2019-06-30T18:34:32.418320+00:00 app[web.1]: > cyprus@1.0.0 start /app
2019-06-30T18:34:32.418324+00:00 app[web.1]: > node server.js
2019-06-30T18:34:32.418325+00:00 app[web.1]:
2019-06-30T18:34:33.279874+00:00 heroku[web.1]: State changed from starting to up
2019-06-30T18:34:32.889328+00:00 app[web.1]: Server running at https://localhost:59348/
2019-06-30T18:34:34.982611+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=kingdom-of-cyprus.herokuapp.com request_id=5f8137a5-c584-4b40-8089-58ba67f88de3 fwd="165.120.137.21" dyno=web.1 connect=0ms service=1ms status=503 bytes=0 protocol=https
2019-06-30T18:34:35.256350+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/favicon.ico" host=kingdom-of-cyprus.herokuapp.com request_id=6223ae91-d44d-4762-a9d9-971f923a5cc8 fwd="165.120.137.21" dyno=web.1 connect=2ms service=3ms status=503 bytes=0 protocol=https
据日志显示,该站点按预期方式启动,然后立即崩溃。我知道这没有道理。有什么想法吗?
如果有帮助,可以here找到server.js
。有趣的东西始于266行。