Serve sub-domain through a cloudflare worker while domain is with namecheap

I want to serve only a sub-domain through a worker while I keep the main domain on namecheap.

Is there any way to do this?

Effectively, I want ONLY sub.mydomain.com to point to a cloudflare worker.

Hi there,

Easiest way I can think of is to add your website/zone to Cloudflare as you do with any other, then you’d create the DNS records for your apex and current subdomains and point them back to namecheap host, and create a worker for the subdomain you want.
This would mean all traffic would still come through Cloudflare, but if this is not something you want, you could simply gray cloud all DNS records to resolve directly to the origin, except for your worker subdomain.

Take care.