Skip to content

Instantly share code, notes, and snippets.

@ace4gi
Created December 7, 2014 11:11
Show Gist options
  • Select an option

  • Save ace4gi/15b6854c2c30b5d57c29 to your computer and use it in GitHub Desktop.

Select an option

Save ace4gi/15b6854c2c30b5d57c29 to your computer and use it in GitHub Desktop.
express - cors
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment