aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/assets/js/chatServer.js
diff options
context:
space:
mode:
authorMarvin Borner2018-07-20 13:57:57 +0200
committerMarvin Borner2018-07-20 13:57:57 +0200
commit932d439444f10774bff546923cc0a2e5e2f2857b (patch)
treeef9bcc039d263f929b4f4991881a52a8343c1dfe /resources/assets/js/chatServer.js
parentbd04ac097a0a29ba7c48a5f4a46d99ae7d86eea1 (diff)
Rewrite (only for backend/oauth/api use from now on)
Diffstat (limited to 'resources/assets/js/chatServer.js')
-rwxr-xr-xresources/assets/js/chatServer.js26
1 files changed, 0 insertions, 26 deletions
diff --git a/resources/assets/js/chatServer.js b/resources/assets/js/chatServer.js
deleted file mode 100755
index fb6c7fc..0000000
--- a/resources/assets/js/chatServer.js
+++ /dev/null
@@ -1,26 +0,0 @@
-var app = require('express')();
-var server = require('http').Server(app);
-var io = require('socket.io')(server);
-var redis = require('redis');
-var port = 8890;
-
-server.listen(port, function () {
- console.log("Listening on " + port)
-});
-
-io.on('connection', function (socket) {
-
- console.log("new client connected");
- var redisClient = redis.createClient();
- redisClient.subscribe('message');
-
- redisClient.on("message", function (channel, message) {
- console.log("new message" + message);
- socket.emit(channel, message);
- });
-
- socket.on('disconnect', function () {
- console.log("client connected");
- redisClient.quit();
- });
-});