How can I transform a React Springboot application into a .war file
CodePudding user response:
You should be able to simply package the react production build and serve it statically from a Springboot application.
Here's a quick tutorial on how this can be done fairly easily while still being able to call API routes on the same domain.
https://www.kantega.no/blogg/webapp-with-create-react-app-and-spring-boot
P.S. This tutorial is intended for a jar
build but making a war
instead shouldn't be much different, might be to just change the value in the config file.
CodePudding user response:
I would make docker files, and split the react app and the spring boot be. Then you create a docker-compose file and do a docker-compose up on server.