Is it possible to make specific worker services accessible only through service bindings?
Hi 👋 ! Is it possible to make specific worker services accessible only through service bindings?
4 Replies
I believe you can do
workers_dev = false
and assign zero routes to it, and then it's inaccessible outside of a service bindingBut if the worker is not assigned any routes, then how can I access it using a service binding??
Could you please give a code example for connecting to a service binding @cherryjimbo ??
When sending a request to the connected worker, isn't the URL of the request important??
It's not, no. The routes just define where it's "listening" and responding to. If there's no routes, it doesn't matter. You could hit
http://some-unknown-host/some-path
and your worker would still get it when you use env.SERVICE.fetch('http://some-unknown-host/some-path')
for exampleOkay, I understand. Thanks for your help @cherryjimbo !