Skip to content

Commit 4908f78

Browse files
committed
Cleanup example README
1 parent 2c82833 commit 4908f78

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

example/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Chat Example
22

3-
This directory contains a full stack example
4-
of a simple chat webapp using nhooyr.io/websocket.
3+
This directory contains a full stack example of a simple chat webapp using nhooyr.io/websocket.
54

65
```bash
76
$ cd example
@@ -15,11 +14,11 @@ Visit the printed URL to submit and view broadcasted messages in a browser.
1514

1615
## Structure
1716

18-
The frontend is contained in `index.html`, `index.js` and `index.css`. It setups the
19-
DOM with a form at the buttom to submit messages and at the top is a scrollable div
20-
that is populated with new messages as they are broadcast. The messages are received
21-
via a WebSocket and messages are published via a POST HTTP endpoint.
17+
The frontend is contained in `index.html`, `index.js` and `index.css`. It sets up the
18+
DOM with a scrollable div at the top that is populated with new messages as they are broadcast.
19+
At the bottom it adds a form to submit messages.
20+
The messages are received via the WebSocket `/subscribe` endpoint and published via
21+
the HTTP POST `/publish` endpoint.
2222

2323
The server portion is `main.go` and `chat.go` and implements serving the static frontend
24-
assets as well as the `/subscribe` WebSocket endpoint for subscribing to
25-
broadcast messages and `/publish` for publishing messages.
24+
assets, the `/subscribe` WebSocket endpoint and the HTTP POST `/publish` endpoint.

0 commit comments

Comments
 (0)