title: Serving the frontend contents with Spring Boot and Tomcat
body: <p>I'm going to create a very typical and not resource-demanding frontend+backend project, and my general question is how to organize it in a better way.</p>
  
  <p>The backend part provides a REST API and here Java and Spring Boot will be utilized. The question about having embedded Tomcat or deploying a WAR is still open. I would prefer to deploy a WAR, unless another option has some advantages for my case. For the development I use Eclipse and Maven, and eventually all this will work on RHEL.</p>
  
  <p>The frontend part is a web-application implementing a UI that accesses the API. Here I'm going to use React.</p>
  
  <p>The number of tutorials suggest to utilize <em>frontend-maven-plugin</em> for serving the frontend content by the means of Spring Boot (using <em>node</em> and <em>npm</em> under the hood). This looks nice and compact. As a result we have a web-app at:</p>
  
  <pre><code>http://my.domain:8080/index.html
  </code></pre>
  
  <p>accessing the API at:</p>
  
  <pre><code>http://my.domain:8080/api/...
  </code></pre>
  
  <p>But no one of those I have found so far suggests to run the web-app at the default http port (80) at:</p>
  
  <pre><code>http://my.domain/index.html
  </code></pre>
  
  <p>which I consider as a must for real production.</p>
  
  <p>There are also ways to redirect calls from port 80 to 8080, but doesn't this look like a tricky patch?
  Apache Tomcat itself can be (apparently) configured to run on port 80, but this does not look nice for me as well.</p>
  
  <p>So, is there a way to organize such a project as a whole one (preferably managed by Spring Boot and Tomcat) and not having its parts "scattered" around in different independent services?</p>