为什么 Heroku 网站不能使用我的应用程序名称? [应用程序错误]

Why is Heroku site not working with my app name? [Application Error]

我已经使用 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

这是 .py 文件中的端口信息,

Heroku 会自动为您的 heroku 应用程序分配一个端口,因此当您无法将端口设置为固定数字时。 Heroku 将端口添加到环境中,因此您可以从那里拉取它。换个听法:

.listen(process.env.PORT || 5000)

这样当你在本地测试时它仍然会监听端口 5000,但它也可以在 Heroku 上运行。

如果这个答案对您有帮助,请告诉我

检查这个答案