Did a lot. Tested SSE & started on socket.io, should prob kill s.io replace w/ ws
This commit is contained in:
17
api/smsGatewayLogs.js
Normal file
17
api/smsGatewayLogs.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const path = require("path");
|
||||
const { addMessage } = require(path.join(__dirname + "/redis.js"));
|
||||
|
||||
const io = (io) => {
|
||||
io.on("connection", socket => {
|
||||
let localData = null;
|
||||
console.log("does this happend second")
|
||||
|
||||
socket.on("message", msg => {
|
||||
msg.localData = localData;
|
||||
msg.timestamp = new Date().getTime();
|
||||
io.emit("message", msg);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = io;
|
||||
Reference in New Issue
Block a user