-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental: cloudflare workers example
- Loading branch information
1 parent
48d3139
commit 3348873
Showing
7 changed files
with
1,986 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.wrangler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 :-)"} | ||
``` | ||
|
||
|
Oops, something went wrong.