title: Deploying Spring Boot + Angular (4) to Elastic Beanstalk
body: <p>I've created a Spring Boot application, packaged in a WAR which I uploaded onto Elastic Beanstalk. So far, so good: my REST endpoints can be contacted, database is working fine. </p>
  
  <p>I then included some static content in the WAR, namely an Angular (4) app. Locally, this works like expected: when running the war, after my endpoints are mapped, Spring picks up the index.html file and serves it as my welcome page (line 4). When surfing to localhost:5000, the Angular app shows up.</p>
  
  <pre><code>2017-08-12 17:13:45.413  INFO 8660 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-08-12 17:13:45.414  INFO 8660 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-08-12 17:13:45.462  INFO 8660 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-08-12 17:13:45.517  INFO 8660 --- [           main] oConfiguration$WelcomePageHandlerMapping : Adding welcome page: ServletContext resource [/index.html]
  2017-08-12 17:13:46.065  INFO 8660 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
  2017-08-12 17:13:46.145  INFO 8660 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 5000 (http)
  2017-08-12 17:13:46.152  INFO 8660 --- [           main] b.n.g.MyApplication            : Started MyApplication in 70.311 seconds (JVM running for 70.76)
  </code></pre>
  
  <p>However, on Elastic Beanstalk, this serving-of-the-index.html line is missing, and I'm not finding a way to get my Angular app to show up:</p>
  
  <pre><code>2017-08-12 15:45:16.655  INFO 21219 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-08-12 15:45:16.656  INFO 21219 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-08-12 15:45:16.745  INFO 21219 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
  2017-08-12 15:45:17.730  INFO 21219 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
  2017-08-12 15:45:17.840  INFO 21219 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 5000 (http)
  2017-08-12 15:45:17.850  INFO 21219 --- [           main] b.n.g.MyApplication            : Started MyApplication in 11.8 seconds (JVM running for 12.765)
  </code></pre>
  
  <p><strong>What am I missing here?</strong></p>
  
  <ul>
  <li>Is this related to NgInx? </li>
  <li>Is it simply not possible for Elastic Beanstalk to serve static / html / js (angular) files which are packaged in the WAR? If so: why not...?</li>
  <li>If it's not possible: I guess the solution is deploying my backend on Elastic Beanstalk and placing the Angular frontend on S3?</li>
  </ul>