An online CORS proxy using Cloudflare Workers to expose as a consumible service wich adds necessary CORS headers to a third party API response Created using Cloudflare Worker
A specific working example (with url of worker changed) could be :
let fetchedResponse = fetch("https://my-worker-path.workers.dev/corsproxy/?apiurl=https://api.to.call).then(function(d) {return d.json()});
The project uses the following libraries:
- Node.js
- Wrangler
- Prettier
- JsHint
- HTTP Headers API
To deploy using serverless add a serverless.yml
file.