I made a React WebShop for testing using a tutorial and wanted to integrate it into my website to test, but unfortunately every time I do so, the app gets messed up. Meaning the links make no sense. For when I type in the url with /Shop (shop is the folder in the server where the app sits) the 404 page, in my case called default component gets displayed. And when I click on the product link it gets me there but as soon as I refresh I'm on the index page of my website instead of the subfolder with the app.
Sorry, but I can't really explain what I mean very well.
PhiGuy
Developer and Crypto Enthusiast
I checked out your repository that you linked.
You need to run
npm run buildThis will create the build directory for you. This is essentially the folder that you deploy for production. So if you're serving your site with apache or nginx, you want to point the server at /your/project/directory/build .
If you're serving your site with NodeJS, same thing. Serve the build directory, and it should automatically pick up the index.html file.
I hope this helps.