简体   繁体   中英

Hosting create-react-app on gh-pages

I'm trying to host this repo ( 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 ) its coming up blank and I'm unsure where I went wrong.

When hosting locally I was using bashhistory but as directed by the guide I simply changed 'bash' to 'hash' in my project and added /#/ to the url, is there more to this that I'm missing?

Also while hosting locally I connected my front-end to my back-end with proxy in package.json file. Can I just change this to my heroku url or do I need something like cors?

Note: I'm using the gh-pages branch

Thanks for the help.

In your repo , you are attempting to use the browserHistory when it should be hashHistory

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM