Skip to content

Commit

Permalink
docs: update workers example readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehesp committed Feb 3, 2023
1 parent 8936f51 commit 74010e4
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions packages/cloudflare_workers/example/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
# Cloudflare Workers

Add this file to the `.dart_tool/workers/entry.js` directory:

> Temporary workaround until CLI is in place.
## Development

```js
// This is a generated file, do not modify.
import "./main.dart.js";
To run this example locally:

export default {
async fetch(request, env, ctx) {
if (self.__dartFetchHandler !== undefined) {
return self.__dartFetchHandler(request, env, ctx);
}
},
async scheduled(event, env, ctx) {
if (self.__dartScheduledHandler !== undefined) {
return self.__dartScheduledHandler(event, env, ctx);
}
}
};
```bash
wrangler dev --local
```

## Development
## Deploy

To run this example locally:
To deploy, this example:

```bash
wrangler dev --local
wrangler publish
```

0 comments on commit 74010e4

Please sign in to comment.