为什么我的应用名称Heroku网站无法使用?应用错误]

问题描述 投票:0回答:1

我在Udacity课程中使用git将文件从电脑推送到heroku,捆绑应用发布到网络上。

当我使用 https:/git.heroku.commmishal001.git。 根据我的git bash输出 - 它给我的是 Method not allowed

在做研究的时候,有一个堆栈的答案,要使用 https:/mmishal001.herokuapp.com 但它给我一个 Application Error

如何才能成功查看我的网站?

这里是日志。

2020-05-22T21:08:45.108618+00:00 app[api]: Initial release by user [email protected]
2020-05-22T21:08:45.108618+00:00 app[api]: Release v1 created by user [email protected]
2020-05-22T21:08:45.278750+00:00 app[api]: Release v2 created by user [email protected]
2020-05-22T21:08:45.278750+00:00 app[api]: Enable Logplex by user [email protected]
2020-05-22T21:52:19.000000+00:00 app[api]: Build started by user [email protected]
2020-05-22T21:52:46.729204+00:00 app[api]: Deploy 04bcf12c by user [email protected]
2020-05-22T21:52:46.729204+00:00 app[api]: Release v3 created by user [email protected]
2020-05-22T21:52:46.751622+00:00 app[api]: Scaled to web@1:Free by user [email protected]
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 文件。.py file

heroku web-deployment git-bash
1个回答
1
投票

Heroku会自动给你的heroku应用分配一个端口,所以当你不能把端口设置成一个固定的数字时。Heroku会把端口添加到env中,所以你可以从那里拉它。把你的listen换成这个。

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

这样你在本地测试的时候,它还是会监听5000端口 但在Heroku上也能正常工作。

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

对答 https:/stackoverflow.coma156933716392696。

© www.soinside.com 2019 - 2024. All rights reserved.