Connecting Cloudflare Workers with Service Bindings

I’ll warn you ahead of time and say this post isn’t too much more than what you can find in the documentation, but I wanted to see it work for myself so I had to setup a test locally. Cloudflare Service bindings are a way for one Worker to connect to another. That seems simple enough, but while it defines a "connection", that connection is completely internal to the Cloudflare environment. I.e., incredibly fast with much lower latency. Let’s consider a simple example. The Receiver # I began by creating a worker, named backworker, with just a simple message: export default { async fetch(request, env, ctx) { return new Response('Hello from Backworker'); },}; The Front... more →
Posted in: JavaScript