Spaces:
Sleeping
Sleeping
Anuj-Panthri
commited on
Commit
·
5d2be44
1
Parent(s):
d60b4e5
sent message console log
Browse files
index.js
CHANGED
@@ -12,6 +12,7 @@ const socketio = require("socket.io")(http);
|
|
12 |
socketio.on("connection",(userSocket)=>{
|
13 |
//socket listening for send_message
|
14 |
userSocket.on("send_message",(data)=>{
|
|
|
15 |
userSocket.broadcast.emit("receive_message",data);
|
16 |
});
|
17 |
});
|
|
|
12 |
socketio.on("connection",(userSocket)=>{
|
13 |
//socket listening for send_message
|
14 |
userSocket.on("send_message",(data)=>{
|
15 |
+
console.log("sent a message!");
|
16 |
userSocket.broadcast.emit("receive_message",data);
|
17 |
});
|
18 |
});
|