Skip to content

Commit f71bae6

Browse files
committed
Document why publish endpoint and not sending messages over WebSocket
See #174 (comment)
1 parent d6ca324 commit f71bae6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: examples/chat/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Visit the printed URL to submit and view broadcasted messages in a browser.
1717
The frontend is contained in `index.html`, `index.js` and `index.css`. It sets up the
1818
DOM with a scrollable div at the top that is populated with new messages as they are broadcast.
1919
At the bottom it adds a form to submit messages.
20+
2021
The messages are received via the WebSocket `/subscribe` endpoint and published via
21-
the HTTP POST `/publish` endpoint.
22+
the HTTP POST `/publish` endpoint. The reason for not publishing messages over the WebSocket
23+
is so that you can easily publish a message with curl.
2224

2325
The server portion is `main.go` and `chat.go` and implements serving the static frontend
2426
assets, the `/subscribe` WebSocket endpoint and the HTTP POST `/publish` endpoint.

0 commit comments

Comments
 (0)