title: GET http://localhost:4200/resource 404 (Not Found)
body: <p>I am trying to get data from a Spring boot application to an Angular application.</p>
  
  <p>My Angular component has the following code:</p>
  
  <pre class="lang-ts prettyprint-override"><code>constructor(private http: HttpClient) { 
      http.get('resource').subscribe(data =&gt; this.greeting = data);
  }
  </code></pre>
  
  <p>My Spring boot controller has the following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>@RequestMapping("/resource")
  public Map&lt;String,Object&gt; home() {
      Map&lt;String,Object&gt; model = new HashMap&lt;String,Object&gt;();
      model.put("id", UUID.randomUUID().toString());
      model.put("content", "Hello World");
      return model;
  }
  </code></pre>
  
  <p>However, when I run this application, I get a 404 error as seen in the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/Ja6Kl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ja6Kl.png" alt="enter image description here"></a></p>