【发布时间】:2021-05-13 13:12:47
【问题描述】:
我尝试将后端部署到 Heroku,之后我的网站仍在运行 http://localhost:3000/,但在我构建应用程序以在 GitHub 页面上进行部署后,该网站停止在 Github 页面上运行,但在本地环境中运行。
这是我的 GitHub 存储库:https://github.com/pranjalchaplot/missedmessage/
我部署的 GitHub 页面(不起作用):https://pranjalchaplot.github.io/missedmessage/
【问题讨论】:
-
在您的客户端文件夹中,使用
npm build重新生成静态文件并将这些文件提交到您的gh-pages分支。 -
@TinNguyen 尝试过,但它不起作用,我将 package.json 中的主页更改为我的 GitHub 页面部署链接,但在再次构建它并将更改提交到 gh-page 分支后仍然无法正常工作
标签: reactjs heroku github-pages npm-build github-pages-deploy-action