repl.it
@octavelr/

lasagnafilm

Nodejs

No description

fork
loading
Files
  • index.js
  • config.json
  • Packager files
  • package-lock.json
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

io.on('connection', function(socket){
  socket.on('disconnect', function(){
    console.log('user disconnected');
  });
  socket.on('sendToggleColorful', function() {
    io.emit('toggleColorful', '');
  })
  socket.on('sendChangeTitle1', function(data) {
    io.emit('changeTitle1', data);
  })
  socket.on('sendChangeTitle2', function(data) {
    io.emit('changeTitle2', data);
  })
  socket.on('sendEval', function(data) {
    io.emit('eval', data);
  })
});

http.listen(8080, function(){
  console.log('listening on *:8080');
});
Fetching token
?