Add barebone to support socket.io

(This is more a temp commit to update the frontend)
This commit is contained in:
2021-05-06 15:24:20 +02:00
parent 533749c7c8
commit 9f1aa50681
16 changed files with 26370 additions and 3185 deletions

View File

@@ -1,5 +1,3 @@
import * as amqp from 'amqplib';
import { Schema, SchemaType } from 'mongoose';
import { logger, RABBITMQ_URI } from '../app';
import { Beat } from '../models/beat/beat.model.';
import { ISeverity, NotificationType } from '../models/notifications/notification.interface';

24
backend/lib/socketio.ts Normal file
View File

@@ -0,0 +1,24 @@
import * as socketio from "socket.io";
/**
* This class handles all SocketIO connections.
*
* *SocketIO is another layer ontop of WebSockets*
*/
class SocketManager {
io: socketio.Server;
express: Express.Application;
constructor (express: Express.Application) {
this.io = new socketio.Server(express);
this.express = express;
}
init() {
this.io.on('connect', data => {
console.log('New connection')
});
}
}