title: Origin http://localhost is not allowed by Access-Control-Allow-Origin
body: <p>I'm trying to do a fetch from backbone.js to my node.js server. However, I get the following error in the console:</p>
  
  <p><code>Origin http://localhost is not allowed by Access-Control-Allow-Origin.</code></p>
  
  <p>I added the following to my node.js server:</p>
  
  <pre><code>var allowCrossDomain = function(req, res, next) {
      res.header('Access-Control-Allow-Origin', "http://localhost");
      res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
      res.header('Access-Control-Allow-Headers', 'Content-Type');
  };
  
  app.configure(function() {
      app.use(allowCrossDomain);
  });
  </code></pre>
  
  <p>But it's still returning the same error. However, even if this did work, it doesn't seem like the ideal solution, as I would like users from all over to be able to send requests.</p>