github.com/StackExchange/dnscontrol/v4@v4.11.0/documentation/language-reference/domain-modifiers/CF_WORKER_ROUTE.md (about) 1 --- 2 name: CF_WORKER_ROUTE 3 parameters: 4 - pattern 5 - script 6 parameter_types: 7 pattern: string 8 script: string 9 provider: CLOUDFLAREAPI 10 --- 11 12 `CF_WORKER_ROUTE` uses the [Cloudflare Workers](https://developers.cloudflare.com/workers/) 13 API to manage [worker routes](https://developers.cloudflare.com/workers/platform/routes) 14 for a given domain. 15 16 If _any_ `CF_WORKER_ROUTE` function is used then `dnscontrol` will manage _all_ 17 Worker Routes for the domain. To be clear: this means it will delete existing routes that 18 were created outside of DNSControl. 19 20 {% hint style="warning" %} 21 **WARNING**: This interface is not extensively tested. Take precautions such as making 22 backups and manually verifying `dnscontrol preview` output before running 23 `dnscontrol push`. 24 {% endhint %} 25 26 This example assigns the patterns `api.example.com/*` and `example.com/api/*` to a `my-worker` script: 27 28 {% code title="dnsconfig.js" %} 29 ```javascript 30 D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER), 31 CF_WORKER_ROUTE("api.example.com/*", "my-worker"), 32 CF_WORKER_ROUTE("example.com/api/*", "my-worker"), 33 END); 34 ``` 35 {% endcode %}