mono-io
v1.1.4
Published
IO module for Mono
Downloads
1
Readme
Socket.io module for Mono
Mono-io uses socket.io and socketio-jwt to handle sockets with authorization via JWT.
Installation
npm install --save mono-io
Then, in your configuration file of your Mono application (example: conf/application.js
):
module.exports = {
mono: {
modules: ['mono-io']
}
}
Configuration
mono-io will use the io
property of your configuration (example: conf/development.js
):
module.exports = {
mono: {
io: {
// See options here: https://github.com/socketio/socket.io/blob/master/docs/API.md#new-serverhttpserver-options
}
}
}
Usage
In your modules files, you can access io
instance:
const { io } = require('mono-io')
io.on('connection', function (socket) {
console.log(socket)
})