0

我正在尝试在 gh-pages 上托管此 repo ( https://github.com/bcravens/WorkoutsClient ) 并将其连接到我在 heroku 上托管的后端,但在遵循 create-react-app README 上的 github pages 指南之后 ( https://bcravens.github.io/WorkoutsClient/#github-pages)它出现空白,我不确定我哪里出错了。

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

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

注意:我正在使用 gh-pages 分支

谢谢您的帮助。

4

1 回答 1

1

您的回购中,您正在尝试使用browserHistory应该何时使用hashHistory

render((
  <Provider store={store}>
    <Router history={hashHistory} routes={routes} />
  </Provider>
), document.getElementById('app'))
于 2017-01-02T18:13:17.537 回答