Response to preflight request doesn't pass access control check in NodeJS
<p>I cannot convince why I've encountered following error even I've added following code in NodeJS/ExpressJS.</p>

<blockquote>
  <p>XMLHttpRequest cannot load <a href="http://localhost:9000/polymer/105724/apply" rel="nofollow noreferrer">http://localhost:9000/polymer/105724/apply</a>.
  Response to preflight request doesn't pass access control check: No
  'Access-Control-Allow-Origin' header is present on the requested
  resource. Origin '<a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a>' is therefore not allowed
  access.</p>
</blockquote>

<pre><code>res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.setHeader("Access-Control-Allow-Headers", "X-Requested-With, Content-Type");
</code></pre>