Skip to content

Instantly share code, notes, and snippets.

@AttilaSATAN
Created November 27, 2014 09:03
Show Gist options
  • Save AttilaSATAN/4ce7269184ffae24ad4b to your computer and use it in GitHub Desktop.
Save AttilaSATAN/4ce7269184ffae24ad4b to your computer and use it in GitHub Desktop.
CORS headers
// // Website you wish to allow to connect
// res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3005');
//
// // Request methods you wish to allow
// res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, DELETE');
//
// // Request headers you wish to allow
// res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type,Authorization');
//
// // Set to true if you need the website to include cookies in the requests sent
// // to the API (e.g. in case you use sessions)
// res.setHeader('Access-Control-Allow-Credentials', true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment