A template for handling CORS preflight requests with Workers.
With this Worker, you can handle CORS preflight requests. It passes GET, POST and HEAD requests through to the origin, while OPTIONS requests are answered directly.
index.js
is the content of the Workers script.
To generate using wrangler
wrangler generate myApp https://github.com/conzorkingkong/cors-preflight-template
To deploy using serverless add a serverless.yml
file.