Last active
June 15, 2017 14:49
-
-
Save milingo/c143b076c8c7d0ef1179e52035b62cb1 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
const http = require('http'); | |
const SocketIO = require('socket.io') | |
const server = http.createServer(function (req, res) { | |
... | |
}); | |
const io = SocketIO(server); | |
io.on('connection', (socket) => { | |
socket.emit('tic', { seconds: 0 }); | |
socket.on('tac', (data) => console.log(data)); | |
}); | |
server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment