Skip to content

Commit 1bd9dc9

Browse files
committed
Adds chatroom example using DO hibernation API
1 parent 4a15929 commit 1bd9dc9

File tree

6 files changed

+663
-0
lines changed

6 files changed

+663
-0
lines changed

15-chatroom/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# WebSocket chatroom
2+
3+
## How to Run
4+
5+
First ensure that `uv` is installed:
6+
https://docs.astral.sh/uv/getting-started/installation/#standalone-installer
7+
8+
Now, if you run `uv run pywrangler dev` within this directory, it should use the config
9+
in `wrangler.jsonc` to run the example.
10+
11+
You can also run `uv run pywrangler deploy` to deploy the example.
12+
13+
Navigate to `http://localhost:8787` to see the chatroom.

15-chatroom/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "python-websocket-stream-consumer",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"deploy": "uv run pywrangler deploy",
7+
"dev": "uv run pywrangler dev",
8+
"start": "uv run pywrangler dev"
9+
},
10+
"devDependencies": {
11+
"wrangler": "^4.50.0"
12+
}
13+
}

15-chatroom/pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[project]
2+
name = "python-chatroom"
3+
version = "0.1.0"
4+
description = "Python WebSocket chatroom example"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"webtypy>=0.1.7",
9+
]
10+
11+
[dependency-groups]
12+
dev = [
13+
"workers-py",
14+
"workers-runtime-sdk"
15+
]

0 commit comments

Comments
 (0)