diff --git a/app.js b/app.js index 569ab81..2ac7ede 100644 --- a/app.js +++ b/app.js @@ -11,8 +11,7 @@ io.on('connection', function(socket) { console.log('a user is connected'); socket.on('button', function(msg) { - console.log("got button message"); - console.log(msg); + io.emit('button', msg); }); socket.on('disconnect', function() { diff --git a/index.html b/index.html index c2ff1a2..9f60c14 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,9 @@ //socket.emit('button', "dude"); }); + socket.on('button', function(msg) { + $('#messages').append($('
  • ').text(msg)); + }); \ No newline at end of file