Skip to content

hemanth/cors-now

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cors-now

reverse proxy with CORS headers.

Usage:

Just do a fetch on the below:

https://cors.now.sh/<url>

Example:

// The XKCD URL below doesn't allow CORS.
fetch('https://cors.now.sh/http://xkcd.com/info.0.json')
.then(console.log)
.catch(console.error)

P.S: Make sure you give the absolute URL, or else you will see an error like:

{
  "error": "Only absolute urls are supported"
}

WHY?

  • For reverse proxies.

  • For crawlers, spiders and what not!

License

MIT © Hemanth.HM