heroku - 无法在 heroku 上部署 react-app - 错误状态代码 503
问题描述
当我尝试在 heroku 上部署 react-app 时,它向我发送了以下应用程序 heroku 日志:它在本地运行,但不在 heroku 上
State changed from starting to crashed
2020-05-15T11:25:55.816804+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sakaar.herokuapp.com request_id=08accafa-0117-4e4d-a1b9-8538776d1640 fwd="27.34.50.89" dyno= connect= service= status=503 bytes= protocol=https
2020-05-15T11:27:58.085863+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sakaar.herokuapp.com request_id=67f628ce-e6fe-41a5-803b-9f357854f8ba fwd="27.34.50.89" dyno= connect= service= status=503 bytes= protocol=https
2020-05-15T11:28:03.720923+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sakaar.herokuapp.com request_id=8774160d-883e-4287-9a5d-1a50bbb22937 fwd="27.34.50.89" dyno= connect= service= status=503 bytes= protocol=https
2020-05-15T11:28:19.056335+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/postjob" host=sakaar.herokuapp.com request_id=66263e38-de26-4039-8061-90f60f2828bc fwd="27.34.50.89" dyno= connect= service= status=503 bytes= protocol=https
请帮我在 heroku 上部署这个 react-app。如果你需要什么,请告诉我。
解决方案
这篇文章展示了你只需要几行就可以在两分钟内创建和部署一个 React 应用程序
您可以开始在 Heroku 上免费构建 React 应用程序。
npm install -g create-react-app
create-react-app my-app
cd my-app
git init
heroku create -b https://github.com/mars/create-react-app-buildpack.git
git add .
git commit -m "react-create-app on Heroku"
git push heroku master
heroku open
推荐阅读
- mysql - 按两列小数点后的特定数字选择
- java - 如何使用杰克逊有条件地(在其他属性上)反序列化属性?
- navigation - 如何在 Jssor 中自定义箭头导航
- mysql - SQL:过滤掉列值出现多次的行
- javascript - 从外部 url 获取特定内容 - PHP
- php - 在php中使用正则表达式查找化学式的所有实例
- php - 将存储在会话中的值传递到联系表单 7 中的输入字段
- azure-devops - azure devops 中的“摘要”选项卡上未显示代码覆盖率
- reactjs - “意外令牌”将尝试 react-datepicker
- javascript - 如何根据动态定义的变量解构对象