H
H
HellYeahOmg2018-11-09 10:56:41
GitHub
HellYeahOmg, 2018-11-09 10:56:41

How to fix routing on github?

Uploaded my SPA on react on github pages.
Go to cart not working.
Link to github pages - https://hellyeahomg.github.io/book-store/
Link to code - https://github.com/HellYeahOmg/book-store
The router is in book-store/src/components/Router.js
The problem is that when you go to the cart, the address changes to https://hellyeahomg.github.io/cart, but it should be https://hellyeahomg.github.io/book-store/cart, although the path is the same for everyone.
Even in book-store/src/App.js on line 12 in fetch the address is specified in the same way and works fine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Demian Smith, 2018-11-09
@HellYeahOmg

<BrowserRouter basename="/book-store">...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question