Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var socket = require('socket.io');

// App setup
var app = express();
var server = app.listen(4000, function(){
var server = app.listen(4000, function () {
console.log('listening for requests on port 4000,');
});

Expand All @@ -17,14 +17,14 @@ io.on('connection', (socket) => {
console.log('made socket connection', socket.id);

// Handle chat event
socket.on('chat', function(data){
socket.on('chat', function (data) {
// console.log(data);
io.sockets.emit('chat', data);
});

// Handle typing event
socket.on('typing', function(data){
socket.on('typing', function (data) {
socket.broadcast.emit('typing', data);
});

});
});
Loading