title: Separating frontend and Backend Tomcat apps?
body: <p>I currently have a Spring application that can be run or debugged locally via embedded Tomcat (through spring-boot), or packaged into a war file and deployed as an app. It has some RESTful services, which are consumed by a single-page-application. </p>
  
  <p>Right now, all of the static assets, including the front-end javascript, are contained in the /src/main/webapp directory. This allows rapid development of both the back-end (embedded tomcat can restart quickly for back-end changes), AND front-end code (any changes made to html/javascript/css can be picked up with just a refresh while the app is running in embedded mode).</p>
  
  <p>However, for various reasons outside my control, I am going to have to separate the front-end and the back-end into separate projects which will be developed and deployed separately. This presents a problem - how do I get a local development environment setup with the same kind of rapid development of both the back-end and the front-end on the same development machine? The front-end servlet and the back-end servlet can't run on the same port, and if I set them up to use different ports, then the browser won't let the front-end javascript make requests to the back-end servlet without setting up CORS, which I'd like to avoid.</p>
  
  <p>Eventually, the two apps will either be deployed to the same Tomcat instance, or else a router will route traffic to them such that they're still on the same domain, so that they can talk to each other without CORS. But that doesn't help me for local development.</p>