Creating an HTTP resource to serve the React application from Quarkus
One of the essential parts of the React and Quarkus integration is providing a way for the Quarkus backend to serve the React SPA frontend files. In Figure 11.1, we can see a diagram of the components of our application when deployed as microservices. One of the illustrated elements is the API gateway, which, in this case, is provided as an external component. For a monolithic approach, we’ll need to implement an alternative to this gateway ourselves.
In the Static resources section of Chapter 1, Bootstrapping the Project, we learned that Quarkus automatically serves the static files in the src/main/resources/META-INF
directory at the root path. You might be wondering why we should go through the trouble of implementing additional HTTP endpoints when we could simply configure the build process to copy the React build files to this directory or its effective compilation path (target/classes/META-INF/resources...