Skip to content

Instantly share code, notes, and snippets.

@loonison123
Created October 31, 2014 02:12
Show Gist options
  • Select an option

  • Save loonison123/bee16725ac127e164ddd to your computer and use it in GitHub Desktop.

Select an option

Save loonison123/bee16725ac127e164ddd to your computer and use it in GitHub Desktop.
Node.js CORS allow any domain
var express = require('express');
var app = express();
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment