title: Angular route redirect to backend and return http
body: <p>I have configured a proxy to backend API for my Angular like this </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{
    "/api/*": {
      "target": "http://localhost:3000",
      "secure": false,
      "logLevel": "debug",
      "changeOrigin": true,
      "router": {
        "localhost:4200" : "http://localhost:3000",
        "http://localhost:4200" : "http://localhost:3000"
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>And I want to add a href like this </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="/api/json" color="warn"&gt;JSON&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>That should hit <code>localhost:4200/api/json</code> and be redirected to <code>localhost:3000/api/json</code>, but it does not work.</p>
  
  <p>Using the routing module there is no path <code>{ path: 'api', component: APIRedirectComponent, pathMatch: 'prefix'}</code> that can make an http call that will use the proxy configured. </p>
  
  <p>I was thinking of creating a module that reads the location and then makes a http call, but then I realised that angular will generate a response with <code>text/html</code> and render the page. </p>
  
  <p>How can I design a component that will return a <code>application/json</code> response from a call to the backend or simply proxy to the backend?</p>