listo socket
This commit is contained in:
+1
-14
@@ -5,17 +5,8 @@ const cors = require('cors');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const { createServer } = require('http');
|
||||
const { Server } = require('socket.io');
|
||||
const httpServer = createServer(app);
|
||||
const io = new Server(httpServer, {
|
||||
cors: { origin: 'http://localhost:3046' },
|
||||
// cors: {
|
||||
// origin: [´
|
||||
// 'https://pcpuma.acatlan.unam.mx',
|
||||
// 'https://pcpuma.acatlan.unam.mx:8080',
|
||||
// ],
|
||||
// },
|
||||
});
|
||||
const io = require('./socket').init(httpServer);
|
||||
|
||||
app.use(cors());
|
||||
|
||||
@@ -31,10 +22,6 @@ app.get('/', (req, res) => res.send('API Pcpuma'));
|
||||
|
||||
app.use(require('./routes/index'));
|
||||
|
||||
io.on('connection', (socket) => {
|
||||
console.log('Conectado');
|
||||
});
|
||||
|
||||
httpServer.listen(Number(process.env.PORT), () =>
|
||||
console.log(`API Pcpuma corriendo en el puerto: ${process.env.PORT}`.rainbow)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user