Did a lot. Tested SSE & started on socket.io, should prob kill s.io replace w/ ws

This commit is contained in:
2021-11-26 20:05:42 +01:00
parent 2f88516326
commit b8a61d1a0e
25 changed files with 1200 additions and 47 deletions

17
api/smsGatewayLogs.js Normal file
View 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;