Install http-server:
npm install -g http-server
http-server --corsSimple 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.