title: Deployed Angular 2 on Webserver throws status 0 on get
body: <p>Thanks for the help, in advance.</p>
  
  <p>I have developed a Angular 2 Single-Page Application and build it with <code>ng build</code>. I moved the builded stuff onto a webserver, on which a node.js backend is running on the port <code>4000</code>. If you go to the main page, I try to get something from the backend with:</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>    return this.http
        .get("https://localhost:4000/auto")
        .toPromise()
        .then( (res)=&gt; res.json());</code></pre>
  </div>
  </div>
  </p>
  
  <p>But then I get this error message:</p>
  
  <p>error message:
  <a href="https://i.stack.imgur.com/osord.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/osord.png" alt="enter image description here"></a></p>
  
  <p>It does work if I change localhost to the ip Address of the webserver, but only if cross-origin is allowed in the backend, which I would like to have disabled.</p>
  
  <p>A thing to note is, that I am also using https (ssl certificate) for the first time, so maybe there is something wrong ?</p>
  
  <p>This is my first time deploying something to a real webserver, so I am not sure what is wrong. Everything else seems to work with the build, only got that problem, communicating with the backend on the same webserver (Webserver runs apache). I hope someone can help me. I hope i explained everything necessary, if you need more informations, tell me what you need.</p>