This commit is contained in:
newtbot
2024-01-24 14:21:13 +08:00
parent 4aea6a8e4c
commit e710fa15a1
45 changed files with 463 additions and 828 deletions

View File

@ -0,0 +1,17 @@
const app = require("../app");
const io = ()=> app.io;
// We have to wait for the express HTTP server to be finished starting before we
// can use any of the socket.io stuff.
app.onListen.push(function(){
app.io.on('connection', (socket) => {
console.log('User connected via WebsSocket')
socket.on('disconnect', (socket) => {
console.log('User disconnect via WebsSocket')
});
});
});
module.exports = io;