In this guide, we'll show you how you can create a Cloudflare Worker. Cloudflare Workers are useful because they can allow you to intervene in the requests between users and our servers.
To get started, you will need a Cloudflare account, and your web store will also need to have its DNS hosted at Cloudflare. Not sure if your web store uses Cloudflare? Go to DNS Checker, select "NS" (name servers) from the dropdown menu, type the naked domain, and click "Search". If the name servers that appear have "cloudflare.com" in them, then your company is using Cloudflare.
To learn more about how to use Cloudflare Workers, please refer to their documentation.
Create a Worker
Next, you will need to login to the Cloudflare Dashboard, select the naked domain in question, click "Workers Routes" in the left-hand sidebar, and then click "Manage Workers":
Once you're on the "Overview" page for Workers, click the "Create application" button:
On the following page, click "Create Worker"
Next, give your worker a memorable name and click "Deploy":
Next, click "Edit Code":
Finally, edit your Worker, and be sure to click "Save and deploy" once finished: