Skip to content

Commit ad3b8f4

Browse files
NO-JIRA Update the example for worker service binding (#17477)
The current example does not work, as it needs a named handler.
1 parent fa1a57f commit ad3b8f4

File tree

1 file changed

+3
-0
lines changed
  • src/content/docs/workers/runtime-apis/bindings/service-bindings

1 file changed

+3
-0
lines changed

src/content/docs/workers/runtime-apis/bindings/service-bindings/index.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ main = "./src/workerB.js"
6161
import { WorkerEntrypoint } from "cloudflare:workers";
6262

6363
export class WorkerB extends WorkerEntrypoint {
64+
// Currently, entrypoints without a named handler are not supported
65+
async fetch() { return new Response(null, {status: 404}); }
66+
6467
async add(a, b) { return a + b; }
6568
}
6669
```

0 commit comments

Comments
 (0)