I'm looking for a way to replicate worker wrangler.toml/routes in local dev mode
Probably not possible with wrangler only. Maybe it's possible with miniflare, zero trust and/or WARP client?
# wrangler.toml
# ...
routes = [
{ pattern = "example.test/api*", zone_name = "example.test" },
{ pattern = "localhost:4321/api*", zone_name = "localhost" },
].use() client bundle to serve client app on same worker.proxy feature, to serve /api routes on same domain (localhost)..use()proxyexport default defineConfig({
server: {
proxy: {
'/api': {
// if api worker running on localhost:4321
target: 'http://localhost:4321/api',
changeOrigin: true
},
},
},
})