Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including pernilongo-plugin with all npm packages installed. Try it out:

var pernilongoPlugin = require("pernilongo-plugin")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

pernilongo-plugin v0.11.2

A pomelo plugin that talks to redis for registering, authorizing and unauthorizing users in rooms/topics of a mosquitto server

Pernilongo

Build Status

Example Usage

Make pomelo use the component:

var pernilongo = require('pernilongo-plugin')

...
...

app.configure('production|development', 'connector', function(){
  app.set('connectorConfig',
    ...
    ...
    app.use(pernilongo, {
      pernilongo: {
        redisUrl: "//localhost:6379"
      }
    })
    ...
    ...
})

Then use the component like:

var Handler = function(app) {
  ...
  this.pernilongo = this.app.get('pernilongo')
}

Handler.prototype.registerPlayer = function(msg, session, next) {
  logger.debug('registering player ' + msg.user)
  this.pernilongo.registerPlayer(msg.user, msg.pass).then( res => {
    return next(null, 'player registered!')
  }).catch(e => {
    return next(new Error('failed to register player'))
  })
}

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free