/cors-wtf

CORS W.T.F.?! :-)

MIT LicenseMIT

CORS W.T.F.?! or 'What is the best way to play with cors locally?'

Install http-server:

npm install -g http-server
http-server --cors

Simple example ajax call that requires CORS:

$.ajax({
  type: 'GET',
  url: 'https://api.github.com/',
  crossDomain: true
}).done(function (data) {
  console.log(data);
});

PS: don't try this with url: 'http://www.nytimes.com' as you'll spend a lot of time trying to figure out why it's not working, which is the reason for this repo to exist.

Just works™