Skip to content

Commit

Permalink
Experimental: cloudflare workers example
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkleeman committed Feb 27, 2024
1 parent 48d3139 commit 3348873
Show file tree
Hide file tree
Showing 7 changed files with 1,986 additions and 0 deletions.
1 change: 1 addition & 0 deletions typescript/cloudflare-worker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.wrangler
40 changes: 40 additions & 0 deletions typescript/cloudflare-worker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Cloudflare worker example

This example uses the experimental Cloudflare worker support in the typescript SDK.

To deploy and test the example:

```bash
$ npm run deploy
> [email protected] deploy
> wrangler deploy

⛅️ wrangler 3.29.0
-------------------
Total Upload: 898.22 KiB / gzip: 123.71 KiB
Uploaded cloudflare-worker (3.69 sec)
Published cloudflare-worker (1.32 sec)
https://cloudflare-worker.<yourdomain>.workers.dev
Current Deployment ID: bcd703b7-9619-498a-b7d3-c33575c042ef

$ restate deployments register https://cloudflare-worker.<yourdomain>.workers.dev
Deployment ID: dp_146gfndB2zqJYoGW2d6q91L

❯ SERVICES THAT WILL BE ADDED:
- Greeter
Type: Keyed ⬅️ 🚶🚶🚶
METHOD INPUT TYPE OUTPUT TYPE
greet RpcRequest RpcResponse
greetAndRemember RpcRequest RpcResponse


✔ Are you sure you want to apply those changes? · yes
✅ DEPLOYMENT:
SERVICE REV
Greeter 1

$ curl <restate-instance>:8080/Greeter/greet -H "Content-Type: application/json" -d '{"key": "from Cloudflare"}'
{"response":"Hello from Cloudflare :-)"}
```


Loading

0 comments on commit 3348873

Please sign in to comment.