somewhere
This commit is contained in:
@@ -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))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user