bus.io-session

Session middleware for your bus.io apps

Usage no npm install needed!

<script type="module">
  import busIoSession from 'https://cdn.skypack.dev/bus.io-session';
</script>

README

Build Status NPM version David DM

Bus.IO

Session middleware for bus.io that uses express-session.


var bus = require('bus.io')();
var session = require('bus.io-session');
bus.use(session());

The underlying component is socket.io-handshake.
Which means this middleware component accepts the same configuration options. Here is a complete example.


var expressSession = require('express-session');
var RedisStore = require('connect-redis')(expressSession);
var sessionStore = new RedisStore();
var cookieParser = require('cookie-parser');
var session = require('bus.io-session');

var bus = require('bus.io')(3000);
bus.use(session({store: sessionStore, key:'sid', secret:'secret', parser:cookieParser()}));

Installation and Environment Setup

Install node.js (See download and install instructions here: http://nodejs.org/).

Clone this repository

> git clone git@github.com:turbonetix/bus.io-session.git

cd into the directory and install the dependencies

> cd bus.io-session
> npm install && npm shrinkwrap --dev

Running Tests

Install coffee-script

> npm install coffee-script -g

Tests are run using grunt. You must first globally install the grunt-cli with npm.

> sudo npm install -g grunt-cli

Unit Tests

To run the tests, just run grunt

> grunt spec

TODO