Skip to content

Commit 4cfa15d

Browse files
committed
Update Backend for Collab Service
Room management service on 3004 and coding collaboration on PORT 1234
1 parent b194c7b commit 4cfa15d

File tree

10 files changed

+2424
-25
lines changed

10 files changed

+2424
-25
lines changed

Backend/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ QuestionService/insert_questions_script.py
99
QuestionService/node_modules
1010
user-service/node_modules
1111
MatchingService/node_modules
12+
CollabService/node_modules
1213
/.pnp
1314
.pnp.js
1415

Backend/CollabService/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
const express = require('express');
22
const http = require('http');
33
const { setupWebSocket } = require('./websocket/collabSocket');
4+
// const { WebsocketServer } = require('y-websockets-server');
45

56
const app = express();
7+
//const PORT = 1234;
8+
69
const server = http.createServer(app);
710

811
// Set up WebSocket server and attach to HTTP server
912
setupWebSocket(server);
1013

14+
//const wss = new WebsocketServer(PORT);
15+
//console.log(`Yjs WebSocket server is running on ws://localhost:${PORT}`)
16+
1117
// Basic route to test the server
1218
app.get('/', (req, res) => {
13-
res.send('CollabService is running');
19+
res.send('CollabService using Yjs is running');
1420
});
1521

16-
module.exports = { app, server };
22+
module.exports = { server };

Backend/CollabService/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const app = require('./app')
1+
const { server } = require('./app')
22

33
// Change the port number to listen to a different port but remember to change the port number in frontend too!
4-
app.listen(3004, () => {
5-
console.log("Collab Servicce is Running")
4+
server.listen(3004, () => {
5+
console.log("Collab Service is Running on port 3004")
66
})

0 commit comments

Comments
 (0)