feat: Added rabbitmq to send events

This commit is contained in:
Davidson Gomes 2023-08-02 21:14:21 -03:00
parent f1571b5f66
commit 56d621bab8
2 changed files with 5 additions and 4 deletions

View File

@ -27,7 +27,7 @@ export const initAMQP = () => {
channel.assertExchange(exchangeName, 'topic', { durable: false });
amqpChannel = channel;
logger.log('AMQP initialized');
logger.info('AMQP initialized');
resolve();
});
});

View File

@ -11,7 +11,6 @@ let io: SocketIO;
const cors = configService.get<Cors>('CORS').ORIGIN;
export const initIO = (httpServer: Server) => {
logger.verbose('Initializing Socket.io');
io = new SocketIO(httpServer, {
cors: {
origin: cors,
@ -19,12 +18,14 @@ export const initIO = (httpServer: Server) => {
});
io.on('connection', (socket) => {
logger.verbose('Client connected');
logger.info('User connected');
socket.on('disconnect', () => {
logger.verbose('Client disconnected');
logger.info('User disconnected');
});
});
logger.info('Socket.io initialized');
return io;
};