overhaul
This commit is contained in:
17
consumerWebsite/functions/socket.js
Normal file
17
consumerWebsite/functions/socket.js
Normal 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;
|
Reference in New Issue
Block a user