Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Latest commit

 

History

History
63 lines (38 loc) · 1.83 KB

README.md

File metadata and controls

63 lines (38 loc) · 1.83 KB

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 [email protected]: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