@jajoosam/

chat-server

Express

Socket.io server for chat

fork
loading
Files
  • index.js
  • package-lock.json
  • package.json

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.20429531168302306","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"dmFyIGV4cHJlc3MgPSByZXF1aXJlKCdleHByZXNzJyk7CnZhciBhcHAgPSBleHByZXNzKCk7Cgp2YXIgaHR0cCA9IHJlcXVpcmUoJ2h0dHAnKS5TZXJ2ZXIoYXBwKTsKdmFyIGlvID0gcmVxdWlyZSgnc29ja2V0LmlvJykoaHR0cCk7CgoKaW8ub24oJ2Nvbm5lY3Rpb24nLCBmdW5jdGlvbiAoc29ja2V0KSB7Cglzb2NrZXQub24oJ21lc3NhZ2UnLCBmdW5jdGlvbihkYXRhKSB7CgkJaW8uZW1pdCgibXNnIiwgZGF0YSk7Cgl9KTsKfSk7CgoKaHR0cC5saXN0ZW4oMzAwMCwgZnVuY3Rpb24oKSB7CiAgY29uc29sZS5sb2coJ2xpc3RlbmluZyBvbiAzMDAwJyk7Cn0pOw=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var express = require('express');
var app = express();

var http = require('http').Server(app);
var io = require('socket.io')(http);


io.on('connection', function (socket) {
	socket.on('message', function(data) {
		io.emit("msg", data);
	});
});


http.listen(3000, function() {
  console.log('listening on 3000');
});