Test a Service Binding
At present, calling between two Workers locally is an experimental feature. The feature is being actively worked on, so feel free to give it a try, but if it doesn’t work you’ll need to run both on Cloudflare’s servers.
First, deploy the authentication service using npm run deploy in the authentication-service folder. Once deployed, you can run the photo service from your device, but you must run it remotely on Cloudflare’s servers. Therefore, start the photo service with npm run dev -- --remote in the photo-service folder.
One thing to note is that this will mean requests will hit the production version of your Worker.
With the authentication service deployed and the photo service running remotely from your device, you ...
Get Serverless Apps on Cloudflare now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.