Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 564 Bytes

readme.md

File metadata and controls

39 lines (25 loc) · 564 Bytes

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