javascript - 将 JS 应用程序部署到 Heroku - 错误 H10 503 错误,应用程序崩溃
问题描述
我的应用程序 - https://github.com/amyequinn/weatherApp在终端上完美运行 npm start 但是在将应用程序部署到 Heroku 时它崩溃了,我找不到解决方案。错误是 H10,App Crashed at Get 方法,状态 503...
"2020-05-08T23:13:34.132652+00:00 heroku[路由器]: at=error code=H10 desc="App crashed" 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[路由器]: at=error code=H10 desc="App crashed" 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 crashed" method=GET path="/favicon.ico" host=weather-app-using-api .herokuapp.com request_id=60c048dd-edbd-405d-aee7-740983dbddf fwd="80.189.121.112" dyno= connect= service= status=503bytes= protocol=https"
有任何想法吗??
非常感谢您的帮助!谢谢 :)
解决方案
我按照这个建议让它工作了 - 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
推荐阅读
- python - 我的第一台服务器中的服务器错误在 python 中运行
- angular - 将属性添加到类实例
- jquery - 如何根据用户输入过滤和显示 JSON 数据?
- python - 如果用户输入错误数据,如何编码输入语句以重复
- java - 该列表无法从另一个列表中删除数据
- java - 有没有办法向不讲法语的用户隐藏图像(卡片视图)
- sql-server - 根据不同列的前 10 将一列的 10 行复制到另一个表
- python - MSS,Python:最大客户端数达到分段错误(核心转储)
- javascript - 如何在网页的源代码中进行更改而不会在刷新时消失?
- php - 我的 ajax submit onchange select 仅在第一行上工作