listo socket
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const { Server } = require('socket.io');
|
||||
let io;
|
||||
|
||||
module.exports = {
|
||||
init(httpServer) {
|
||||
io = new Server(httpServer, {
|
||||
cors: {
|
||||
origin: [
|
||||
'http://localhost:3046',
|
||||
'http://localhost:3056',
|
||||
// 'https://pcpuma.acatlan.unam.mx',
|
||||
// 'https://pcpuma.acatlan.unam.mx:8080',
|
||||
],
|
||||
},
|
||||
});
|
||||
return io;
|
||||
},
|
||||
getIO() {
|
||||
if (!io) throw new Error('Socket.io no se ha inicializado ');
|
||||
return io;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user