1.1.2 • Published 7 years ago

@terrajs/mono-io v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Socket.io module for Mono

npm version Travis Coverage license

Mono-io uses socket.io and socketio-jwt to handle sockets with authorization via JWT.

Installation

npm install --save @terrajs/mono-io

Then, in your configuration file of your Mono application (example: conf/application.js):

module.exports = {
  mono: {
    modules: ['@terrajs/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('@terrajs/mono-io')

io.on('connection', function (socket) {
  console.log(socket)
})
1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago