Skip to content

Commit

Permalink
Docs: add missing worker variable declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Kabanov committed Jun 17, 2024
1 parent c2ed3af commit 5ffcdfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/src/content/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ const res = await mf.dispatchFetch("http:https://localhost:8787/", {
});
console.log(await res.text()); // Hello Miniflare!

const worker = await mf.getWorker();

const scheduledResult = await worker.scheduled({
cron: "* * * * *",
});
Expand Down Expand Up @@ -442,6 +444,8 @@ const res = await mf.dispatchFetch("http:https://localhost:8787/", {
const text = await res.text();

// Dispatch "scheduled" event to worker
const worker = await mf.getWorker();

const scheduledResult = await worker.scheduled({ cron: "30 * * * *" })

const TEST_NAMESPACE = await mf.getKVNamespace("TEST_NAMESPACE");
Expand Down

0 comments on commit 5ffcdfa

Please sign in to comment.