title: enable CORS for local http server
body: <p>I hosted my local files with http server. Just install on my Mac HTTP server with command:</p>
  <pre><code>npm install --global http-server
  </code></pre>
  <p>Then I start this server in needed directory with the command:</p>
  <pre><code>http-server
  </code></pre>
  <p>I had the CORS policy problem when trying to fetch my local HTML file from HTTP server response. It was blocked.
  <a href="https://i.stack.imgur.com/dHsoJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dHsoJ.png" alt="Blocked by CORS policy" /></a></p>