tannal / ohmywork

0 stars 0 forks source link

Yjs demo #64

Open tannal opened 1 month ago

tannal commented 1 month ago

安装nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

用nvm安装node,版本20.10.0

nvm install 20.10.0

开一下corepack,这样就有pnpm了


corepack enable

开个新终端,起一个 y-websocket 服务

HOST=localhost PORT=1234 npx y-websocket

改个代码,用自己的服务,见下面的评论

https://github.com/yjs/yjs-demos/blob/5056886c69e8628df0747e83a1a6689cf1b9ad38/quill/quill.js#L14

这一行的地址改成

ws://localhost:1234

git clone https://github.com/yjs/yjs-demos.git
cd yjs-demos
pnpm install
pnpm start
tannal commented 1 month ago

去浏览器localhost:3000看看,选quill