forked from quic-issues/427e7578-d7bf-49c8-aee9-2dd999e25316
cleanup (subfolder removed, npm packages removed, etc.); added y-websocket-server code
This commit is contained in:
29
README.md
29
README.md
@@ -1,7 +1,28 @@
|
||||
# P2P Poll App
|
||||
|
||||
## Setup
|
||||
mkdir yjs-poll
|
||||
cd yjs-poll
|
||||
## Install npm packages
|
||||
```
|
||||
npm init -y
|
||||
npm install y-websocket ws
|
||||
npm install
|
||||
```
|
||||
|
||||
Note: the frontend obtains the packages `yjs` and `y-websocket` dynamically.
|
||||
|
||||
## Run backend
|
||||
```
|
||||
node backend.js
|
||||
```
|
||||
|
||||
### Note on Yjs suggestion
|
||||
Note that the following server setup is suggested in the Yjs docs (https://docs.yjs.dev/ecosystem/connection-provider/y-websocket):
|
||||
```
|
||||
npm install y-websocket-server
|
||||
HOST=localhost PORT=1000 npx y-websocket
|
||||
```
|
||||
|
||||
However, across a range of npm versions, this does not work.
|
||||
Nevertheless, the essential code from the `y-websocket-server` package is used here as provided in `utils.js`.
|
||||
|
||||
## Run frontend
|
||||
Open "frontend.html" in browser.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user