added / route

Signed-off-by: heyhiru <hirentimbadiya74@gmail.com>
Este commit está contenido en:
heyhiru
2023-11-16 23:32:30 +05:30
padre 4546d59104
commit 05d23685c2
Se han modificado 3 ficheros con 1128 adiciones y 6 borrados

Ver fichero

@@ -1,10 +1,22 @@
const { Server } = require('socket.io');
const express = require('express');
const cors = require('cors');
const http = require('http');
const io = new Server(8080, {
cors: true
});
const app = express();
const server = http.createServer(app);
app.use(cors());
app.get("/" , (req, res) => {
res.send("Hello World");
});
const emailToSocket = new Map();
const socketToEmail = new Map();
@@ -47,4 +59,6 @@ io.on("connection", (socket) => {
socket.on("call:initiated", ({ to }) => {
io.to(to).emit("call:initiated", { from: socket.id });
});
})
})
server.listen(process.env.PORT || 8081, () => console.log(`Server has started.`));