Created
August 10, 2019 22:10
-
-
Save blarmon/86c50125f01d65ef6fd5338abb08aef7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let app = require('express')(); | |
let http = require('http').createServer(app); | |
let io = require('socket.io')(http); | |
io.on('connection', function(socket) { | |
console.log('someone connected!') | |
socket.on('chat message', function(msg){ | |
io.emit('chat message', msg); | |
}); | |
}); | |
http.listen(3000, function(){ | |
console.log('listening on *:3000'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment