Skip to content

Commit d81edfe

Browse files
committed
setup yjs server configurations
1 parent 0378fac commit d81edfe

File tree

3 files changed

+189
-71
lines changed

3 files changed

+189
-71
lines changed

api/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import express from "express";
33
import {Server} from "socket.io";
44
import {createServer} from "http";
55
import cors from 'cors';
6+
import {ySocketIO} from 'y-socket.io';
67

78
const app = express();
89
const server = createServer(app);
@@ -11,6 +12,10 @@ const io = new Server(server, {
1112
});
1213
const PORT = 8000;
1314

15+
const ysocketio = new ySocketIO(io, {});
16+
17+
ysocketio.initialize();
18+
1419
app.use(cors({origin: '*'}))
1520

1621
app.get('/', (req, res)=>{

0 commit comments

Comments
 (0)