multy-stub/server/io.js

14 lines
254 B
JavaScript
Raw Normal View History

2023-08-01 13:14:02 +03:00
const { Server } = require('socket.io')
const { createServer } = require('http')
let io = null
module.exports.setIo = (app) => {
const server = createServer(app)
io = new Server(server, {})
return server
}
module.exports.getIo = () => io