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

时间:2017-01-02 17:34:23

标签: reactjs heroku react-router github-pages create-react-app

我正在尝试在gh-pages上托管这个repo(https://github.com/bcravens/WorkoutsClient)并将它连接到我在heroku上托管的后端,但是在关注了create-react-app自述文件的github页面指南之后({{3它出现了空白,我不确定我哪里出错了。

当我在本地托管时,我正在使用bashhistory但是在指南的指导下,我只是在我的项目中将'bash'更改为'hash'并将/#/添加到url中,还有更多我不知道的吗?< / p>

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

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

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

your repo中,您尝试使用browserHistory hashHistory

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