我已经使用git将文件从计算机推送到heroku,该捆绑了该应用,以便在Udacity课程期间在网络上发布。
当我根据git bash输出使用https://git.heroku.com/mmishal001.git时-它给了我Method not allowed
在进行研究时,有一个使用https://mmishal001.herokuapp.com/的答案,但是它给了我Application Error
如何成功查看我的网站?
以下是日志:
2020-05-22T21:08:45.108618+00:00 app[api]: Initial release by user mohammedmishal@live.com
2020-05-22T21:08:45.108618+00:00 app[api]: Release v1 created by user mohammedmishal@live.com
2020-05-22T21:08:45.278750+00:00 app[api]: Release v2 created by user mohammedmishal@live.com
2020-05-22T21:08:45.278750+00:00 app[api]: Enable Logplex by user mohammedmishal@live.com
2020-05-22T21:52:19.000000+00:00 app[api]: Build started by user mohammedmishal@live.com
2020-05-22T21:52:46.729204+00:00 app[api]: Deploy 04bcf12c by user mohammedmishal@live.com
2020-05-22T21:52:46.729204+00:00 app[api]: Release v3 created by user mohammedmishal@live.com
2020-05-22T21:52:46.751622+00:00 app[api]: Scaled to web@1:Free by user mohammedmishal@live.com
2020-05-22T21:52:50.870397+00:00 heroku[web.1]: Starting process with command `python BookmarkServer.py`
2020-05-22T21:52:55.000000+00:00 app[api]: Build succeeded
2020-05-22T21:53:51.264392+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-05-22T21:53:51.314513+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-05-22T21:53:51.498696+00:00 heroku[web.1]: Process exited with status 137
2020-05-22T21:53:51.545336+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-22T21:53:51.547570+00:00 heroku[web.1]: State changed from crashed to starting
2020-05-22T21:53:54.506792+00:00 heroku[web.1]: Starting process with command `python BookmarkServer.py`
2020-05-22T21:54:54.727943+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-05-22T21:54:54.749643+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-05-22T21:54:54.863009+00:00 heroku[web.1]: Process exited with status 137
2020-05-22T21:54:54.904317+00:00 heroku[web.1]: State changed from starting to crashed
2020-05-22T21:59:33.545036+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mmishal001.herokuapp.com request_id=4587c886-5ab7-4677-aa98-51b0bdd23c6d fwd="92.98.87.71" dyno= connect= service= status=503 bytes= protocol=https
2020-05-22T21:59:34.335527+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mmishal001.herokuapp.com request_id=416ec5ae-4cf5-4aee-b4d6-16c0346c9aa6 fwd="92.98.87.71" dyno= connect= service= status=503 bytes= protocol=https
2020-05-22T22:00:48.204841+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mmishal001.herokuapp.com request_id=b4721bbe-2a11-4a24-abde-28c7e44436aa fwd="92.98.87.71" dyno= connect= service= status=503 bytes= protocol=https
2020-05-22T22:00:49.025113+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mmishal001.herokuapp.com request_id=c8039bf7-ae5c-4aa0-9dd9-d2a4a1100e13 fwd="92.98.87.71" dyno= connect= service= status=503 bytes= protocol=https
2020-05-22T22:02:33.399278+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mmishal001.herokuapp.com request_id=a3dd26f4-8267-4576-b86b-bf44fe0fef18 fwd="92.98.87.71" dyno= connect= service= status=503 bytes= protocol=https
2020-05-22T22:02:33.908128+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mmishal001.herokuapp.com request_id=0f31c73b-beec-4d38-b8f1-b055fbae76a0 fwd="92.98.87.71" dyno= connect= service= status=503 bytes= protocol=https
答案 0 :(得分:1)
Heroku自动为您的heroku应用程序分配一个端口,因此当您无法将端口设置为固定编号时。 Heroku将端口添加到环境中,因此您可以从那里拉出它。切换至此:
.listen(process.env.PORT || 5000)
这样,当您在本地测试时,它仍然会监听端口5000,但它也可以在Heroku上运行。
让我知道这个答案是否对您有帮助