cleanup (subfolder removed, npm packages removed, etc.); added y-websocket-server code

This commit is contained in:
User
2026-03-16 02:26:57 +01:00
committed by Jannik Luboeinski
parent 78d5352a48
commit c89c6f95a6
1060 changed files with 610 additions and 101426 deletions

View File

@@ -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.