title: Angular 7 appilication cannot reach web API once published
body: <p>I have a Angular 7 Application with .Net core 2.1, once the application is publish it cannot reach the API, which means no calls can be made, but before i published the application everything worked fine.<em>( i use IIS 10 Express when published)</em>
  What could be the problem and how can i fix this?</p>
  
  <p><strong>Example of a call in my code that checks if the API is accessible:</strong></p>
  
  <p>(this is the first call in my application)</p>
  
  <pre><code>let availabilityHTTPCall = this.http.get("/v1/CheckAvailability");
  availabilityHTTPCall.subscribe(
    (result: boolean) =&gt; {
      this._webApiUnavalable = result;
      this.wizardOpen = true;
      console.log("HTTP Call returned data without error!", result);
    },
    (error) =&gt; {
      console.log("HTTP Call returned an error!", error);
      this._webApiUnavalable = false;
    },
    () =&gt; {
      console.log("HTTP Call complete!");
      this.PlacesOfService();
      this.LoadPhCodes();
    }
  );
  </code></pre>
  
  <p><strong>What the API looks like in the controller:</strong></p>
  
  <pre><code> [HttpGet]
   [Route("CheckAvailability")]
   public Boolean CheckAvailability()
   {
       return true;
   }
  </code></pre>
  
  <p><strong>I usually get one of the following errors</strong></p>
  
  <p>"Http failure during parsing for <a href="http://localhost/" rel="nofollow noreferrer">http://localhost/</a>"</p>
  
  <p>"Unexpected token &lt; in JSON at position 0"</p>
  
  <p>OR</p>
  
  <p>"Http failure response for <a href="http://localhost/v1/CheckAvailability" rel="nofollow noreferrer">http://localhost/v1/CheckAvailability</a>: 404 Not Found"</p>