Hello everyone,
I am working on a Cloudflare Worker project, and the worker will be deployed on a subdomain (i.e. the route key in wrangler.toml is set to foo.mydomain.com). However, I am not able to debug it using wrangler dev
.
When I visit localhost:8787
wrangler redirects me to my root domain, without triggering the worker. I have tried to visit foo.localhost:8787
after modifying /etc/hosts
, but it still doesn’t work.
May I know if there is any way to debug the worker? Or currently I can only debug a worker that is on a root domain/path?
FYI, here is an example of my wrangler.toml
name = "my-worker"
type = "webpack"
account_id = "<account_id>"
workers_dev = false
route = "https://foo.mydomain.com/*"
zone_id = "<zone_id>"
[env.dev]
name = "my-worker-dev"
route = "https://foo-dev.mydomain.com/*"
webpack_config = "webpack.dev.config.js"
Thank you.