Skip to content

Commit

Permalink
NO-JIRA Update the example for worker service binding
Browse files Browse the repository at this point in the history
The current example does not work, as it needs a named handler.
  • Loading branch information
WillTaylorDev committed Oct 10, 2024
1 parent 73fae77 commit 816d4da
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
```
Expand Down

0 comments on commit 816d4da

Please sign in to comment.