🔌 reworked socket.io freeform with moleculer-io

This commit is contained in:
2022-04-16 15:56:24 -07:00
parent 4b9ba28739
commit 9548db5d63
8 changed files with 398 additions and 215 deletions

View File

@@ -1,16 +0,0 @@
import { Server } from "socket.io";
import { createServer } from "http";
export const SocketIOMixin = () => {
const socketServer = createServer();
socketServer.listen(3001, `0.0.0.0`);
const socketIOConnection = new Server(socketServer, {
cors: {
origin: "*",
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
preflightContinue: false,
optionsSuccessStatus: 204,
},
});
return socketIOConnection;
}