Skip to content

html5cat/cors-wtf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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™

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published