somewhere

This commit is contained in:
Swift
2023-08-17 13:05:51 +03:30
parent 30c7eb0e7b
commit 53843207cc
429 changed files with 117489 additions and 1 deletions
@@ -0,0 +1,23 @@
const { isAdmin } = require('../middlewares/ws_authentication')
const adminEventsController = require('../controllers/admin_EventsController')
module.exports.adminNamespace = () => {
const io = global._io
const admin = io.of('/admin')
// admins middlewares
admin.use(isAdmin)
// attach events
admin.on('connection', socket => {
adminEventsController.getAllNotifs(socket)
/// /////////////////////////////////////////////////////// handle connection error
socket.on('connect_error', err => {
console.log(err.message)
})
/// ////////////////////////////////////////////////////// events
// socket.on('admin:getNotifs', () => adminEventsController.getAllNotifs(socket))
})
}