Created
September 2, 2016 19:57
-
-
Save amckinley/621e5cf7039b69b5eec7086edd0a2bd0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//server.js | |
var app = require('express')(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
io.on('connection', function (socket){ | |
console.log('connection made'); | |
socket.on('CH01', function (from, msg) { | |
console.log('MSG', from, ' saying ', msg); | |
}); | |
socket.on('test', function (from, msg) { | |
console.log("we got test"); | |
}); | |
}); | |
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