在 gh-pages 上托管 create-react-app

Hosting create-react-app on gh-pages

我正在尝试托管此存储库 ( https://github.com/bcravens/WorkoutsClient ) on gh-pages and connect it to my backend hosted on heroku but after following the github pages guide on the create-react-app README ( https://bcravens.github.io/WorkoutsClient/#github-pages ),但它是空白的,我不确定哪里出错了。

在本地托管时,我使用的是 bashhistory,但按照指南的指示,我只是在我的项目中将 'bash' 更改为 'hash',并将 /#/ 添加到 url,是吗还有更多我想念的吗?

此外,在本地托管时,我使用 package.json 文件中的代理将我的前端连接到我的后端。我可以将其更改为我的 heroku url 还是我需要像 cors 这样的东西?

注意:我使用的是 gh-pages 分支

感谢您的帮助。

your repo 中,您正在尝试使用 browserHistory,而它应该是 hashHistory

render((
  <Provider store={store}>
    <Router history={hashHistory} routes={routes} />
  </Provider>
), document.getElementById('app'))