提问者:小点点

将JS应用程序部署到Heroku-错误H10 503错误,应用程序崩溃


我的应用程序https://github.com/amyequinn/weatherapp在终端运行npm启动时运行得很好,但是当将应用程序部署到Heroku时,它崩溃了,我找不到解决方案。错误为H10,应用程序在Get方法时崩溃,状态503....

“2020-05-08T23:13:34.132652+00:00 Heroku[router]:at=error code=h10 desc=”App已崩溃“method=get path=”/“host=weather-app-using-api.herokuapp.com request_id=edd028a6-ce4c-4b5f-b3c0-229af9eb24fb fwd=”80.189.121.112“dyno=connect=service=status=503 bytes=protocol=https

2020-05-08T23:13:34.964932+00:00 Heroku[router]:at=error code=h10 desc=“应用程序崩溃”method=get path=“/”host=weather-app-using-api.herokuapp.com request_id=63ded901-6716-4f7a-8f8a-fe0409a9349d fwd=“80.189.121.112”dyno=connect=service=status=503 bytes=protocol=https

2020-05-08T23:13:36.414179+00:00 Heroku[router]:at=error code=h10 desc=“App已崩溃”method=get path=“/favicon.ico”host=weather-app-using-api.herokuapp.com request_id=60c048dd-edbd-405d-aee7-740983dbdedf fwd=“80.189.121.112”dyno=connect=service=status=503bytes=protocol=https“

有什么想法吗??

非常感谢您的帮助!!谢谢:)


共1个答案

匿名用户

我遵循以下建议-https://codeburst.io/deploy-your-webpack-apps-to-heroku-in-3-simple-steps-4AE072AF93A8

创建server.js文件并包含上面链接的内容,确保我的文件路径正确。

在终端中运行“webpack-p”和“npm run dev”或“node server.js”

它已在https://weather-app-using-api.herokuapp.com/上成功发布给Heroku