From 816d4daf2a5e50b0773cae6cf34ae3421febe131 Mon Sep 17 00:00:00 2001 From: Will Taylor Date: Thu, 10 Oct 2024 15:32:36 -0400 Subject: [PATCH] NO-JIRA Update the example for worker service binding The current example does not work, as it needs a named handler. --- .../workers/runtime-apis/bindings/service-bindings/index.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/content/docs/workers/runtime-apis/bindings/service-bindings/index.mdx b/src/content/docs/workers/runtime-apis/bindings/service-bindings/index.mdx index 28f4e8c1b21058..a6e716aab24d4f 100644 --- a/src/content/docs/workers/runtime-apis/bindings/service-bindings/index.mdx +++ b/src/content/docs/workers/runtime-apis/bindings/service-bindings/index.mdx @@ -61,6 +61,9 @@ main = "./src/workerB.js" import { WorkerEntrypoint } from "cloudflare:workers"; export class WorkerB extends WorkerEntrypoint { + // Currently, entrypoints without a named handler are not supported + async fetch() { return new Response(null, {status: 404}); } + async add(a, b) { return a + b; } } ```