Worker custom domain routes

I'm having trouble setting my route via wrangler.toml
[env.development]
route = { pattern = "https://development-api.example.com/trpc-auth*", zone_name = "example.com", custom_domain = true }
[env.development]
route = { pattern = "https://development-api.example.com/trpc-auth*", zone_name = "example.com", custom_domain = true }
I get this error
Cannot use "https://development-api.example.com/trpc-auth*" as a Custom Domain; wildcard operators (*) are not allowed
Cannot use "https://development-api.example.com/trpc-auth*" as a Custom Domain; wildcard operators (*) are not allowed
But then when I go set the route in the console. I can set it and it works as expected. But this is very tedious to do for all my workers. Is my configuration wrong?
2 Replies
MBrimmer
MBrimmer13mo ago
This appears to work, maybe.
[env.development]
routes = [
{ pattern = "development-api.example.com", custom_domain = true },
{ pattern = "https://development-api.example.com/trpc/auth*", zone_name = "example.com" }
]
[env.development]
routes = [
{ pattern = "development-api.example.com", custom_domain = true },
{ pattern = "https://development-api.example.com/trpc/auth*", zone_name = "example.com" }
]
I'd love some clarification, explanation, or further guidance on this. I don't think I fully understand why routes and custom_domains are separate.
kian
kian13mo ago
Custom Domains · Cloudflare Workers docs
Custom Domains allow you to connect your Worker to a domain or subdomain, without having to make changes to your DNS settings or perform any …
Want results from more Discord servers?
Add your server