Disable routes in wrangler.toml

I have a worker that should only be accessible as a service binding and not via Routes or Custom Domains. I know that I can disable the default route in the dashboard, but as soon as I publish the worker via wrangler the default route is enabled again. https://i.imgur.com/oh7qHHj.png I guess that this is due to the default wrangler config. I couldn't find anything in the docs, how to disable routes entirely in the wrangler.toml (https://developers.cloudflare.com/workers/platform/triggers/routes/#matching-behavior) I already tried to set the routes to an empty array like this:
routes = []
routes = []
but didn't have any success with that. Is this even possible, or are the worker services simply too new so that it is not intended to have no triggers? Thanks in advance!
Imgur
Routes · Cloudflare Workers docs
Routes allow users to map a URL pattern to a Worker script to enable Workers to run in front of Custom Domains or their own external application …
3 Replies
Hello, I’m Allie!
That covers routes on custom domains. What you want is
workers_dev = false
workers_dev = false
DerZade
DerZadeOP2y ago
Thanks a lot!
Hello, I’m Allie!
No problem, happy to help!
Want results from more Discord servers?
Add your server