Created
December 16, 2014 21:59
-
-
Save toddself/e2ca3c9fc3869c874db9 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
var express = require('express'); | |
var http = require('http'); | |
var socketio = require('socket.io'); | |
var app = express(); | |
var server = http.Server(app); | |
var io = socketio(server); | |
server.listen(3001); | |
io.sockets.on('connection', function (socket) { | |
console.log('A new user connected!'); | |
socket.emit('info', { msg: 'The world is round, there is no up or down.' }); | |
}); |
Author
toddself
commented
Dec 16, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment