Created
April 17, 2020 07:32
-
-
Save mhemrg/e586c162ad5a3881bcd9fa8f263c9c8a 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
if(process.env.NODE_ENV) { | |
const server = use('http').createServer().listen(9595, () => console.log('Server is listening...')); | |
const io = use('socket.io')(server) | |
io.on('connection', function (socket) { | |
console.log('new connection',socket.id) | |
socket.on('draw',(data)=>{ | |
socket.broadcast.emit('drawing',data); | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment