Svelte.js演示-WebSockets



在此视频中,我们将介绍如何使用REPL将WebSocket与svelte一起使用。

苗条的REPL:
https://svelte.dev/repl/29a5bdfb981f479fb387298aef1190a0?version=3.22.2

Websocket Github:
https://github.com/phptuts/node-relay-server

Ngrok:
https://ngrok.com/

脚步:

git clone https://github.com/phptuts/node-relay-server.git
cd节点中继服务器
npm安装
节点app.js
使用ngrok设置一个帐户。
npm install -g ngrok
ngrok authtoken“您的身份验证令牌”
ngrok http 3000
进入message-store.js文件,并将其替换为您的ngrok网址