Issue
I am trying to deploy my full stack application comprising of react and spring boot but I am not sure what the best approach is. I could either package the react files with in the spring boot jar but I am not sure if that has any implications with respect to security or even performance?
Another option which in my head sounds better is to host the frontend (react) and the backend(springboot) on two different domains but an issue I am facing with that is CORS issue. When running it locally everything was good but as soon I deploy them on two different domains there seems to be a CORS issue?
Any advice would be much appreciated...
Solution
If there is a cors issue then add a cors middleware handler on the springboot side to allow the domain
If the devs for react and spring sides are different then deploy them separately. If 1 team is doing both then deploy it together
Put it/them in a docker container and deploy it on a VPS with Digitalocean
Answered By - Asad Awadia
Answer Checked By - Gilberto Lyons (JavaFixing Admin)