title: Angular 5 Access-Control-Allow-Origin error with localhost
body: <p>I'm leaning Angular, trying to use HTTP get to a file on my PC. I want to simulate the server scenario so tried serving the file with the following,  (live-server, browser-sync &amp; xampp) one at a time, but with every try I get the error  </p>
  
  <blockquote>
    <p>Failed to load <a href="http://localhost/ng-data/products.json" rel="nofollow noreferrer">http://localhost/ng-data/products.json</a>: The 'Access-Control-Allow-Origin' header has a value '<a href="http://localhost:4200/" rel="nofollow noreferrer">http://localhost:4200/</a>' that is not equal to the supplied origin. Origin '<a href="http://localhost:4200" rel="nofollow noreferrer">http://localhost:4200</a>' is therefore not allowed access</p>
  </blockquote>
  
  <p>When I paste the url (<a href="http://localhost/ng-data/products.json" rel="nofollow noreferrer">http://localhost/ng-data/products.json</a>) in my browser I can get the file.</p>