DEV Community

Peter Kronenberg
Peter Kronenberg

Posted on

Integrating with Spring Boot

Hi, I'm an experienced Java developer, but new to React (and Javascript frameworks in general).

What is the best way to integrate React and Spring Boot but still make development possible? I'm following a procedure outlined here https://dev.to/arpan_banerjee7/run-react-frontend-and-springboot-backend-on-the-same-port-and-package-them-as-a-single-artifact-14pa which essentially copies the contents of the React build directory to the target directory, so that Spring can serve the files at runtime. The React build process combines all of the React js files into several compressed js files. The problem with that is then I see requests such as this: GET /static/js/2.09068613.chunk.js, which makes it difficult to know what's going on.

I can't run the Spring server and react server separately, because I'm using Spring Security, which requires that the user is routed through it. So localhost:8080, and not localhost:3000

What's the best way to approach this?

Top comments (0)