From 7513222e2f2a027f1b3c147734d6247eeab5a72f Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Mon, 14 Dec 2020 08:48:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20Add=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/services/redis.js | 0 server/services/socket.js | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 server/services/redis.js create mode 100644 server/services/socket.js diff --git a/server/services/redis.js b/server/services/redis.js new file mode 100644 index 0000000..e69de29 diff --git a/server/services/socket.js b/server/services/socket.js new file mode 100644 index 0000000..dee8c71 --- /dev/null +++ b/server/services/socket.js @@ -0,0 +1,11 @@ +const socket = require('socket.io'); +const chalk = require('chalk') + +module.exports = (server) => { + // noinspection JSValidateTypes + const io = socket(server) + + io.on('connection', socket => { + console.log(chalk.bgWhiteBright.black.bold(`Client with id: ${chalk.bgBlack.whiteBright(socket.id)} just connected!`)); + }); +} \ No newline at end of file