Hey! I would like to get some feedback. I have a new domain `example.com`, and I want a few workers
Hey! I would like to get some feedback. I have a new domain
example.com
, and I want a few workers to serve the content of my sites:
- shop.example.com
-> Remix app on worker
- dashboard.example.com
-> Remix app on worker
- example.com/auth
-> Remix app on worker
- example.com/api
-> workers REST API (hono.js)
Question: Is it an okay practice to call one worker from another worker?
I was thinking of calling example.com/api
from the web app workers to create one source of truth for API calls. Is this generally an acceptable pattern, or should I just query d1 directly in each worker?
Question: How do I point a worker to example.com/api
?
Also, I am a bit confused about how I could point a worker to example.com/api
. This doesn't seem to be doable with a custom worker domain since it includes a pathname. But for a worker route to work, I must already proxy the domain through Cloudflare. I currently have no DNS records. How do I point example.com/api
to the api worker script?0 Replies