Reputation: 115
I'm trying to bundle ReactJS and Spring Boot API together and build one fat jar. In every tutorial I read, I'm told to put the localhost API URL as a proxy in package.json of the React app like below.
"proxy": "http://localhost:8080"
As I obviously don't have PROD deployment experience with this, is this the way to go when you are deploying in PROD? Else, please guide me in the right direction. I couldn't find the answer anywhere.
Also, any cons in doing so in a medium sized project with two developers? Appreciate any input.
Upvotes: 1
Views: 1702
Reputation: 1175
The "proxy" field should only be used in development environment when the Webpack dev server is first in line(to enable the Hot-Reload feature) Here is a guide from 2018: spring + react guide
regardless there are two main way of hosting the react app:
ps. I would read some guides first, it would help you with general understanding
Upvotes: 1