0.1.2 • Published 8 years ago

koa-resession v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Koa-ReSession

Build Status Coverage Downloads Downloads npm version dependencies dev dependencies License

RethinkDB session storage for Koa 2. Uses async/await in favor of generator functions.

Getting Started

Install it via npm:

npm install koa-resession

And include in your project:

import ReSession from 'koa-resession';
import session from 'koa-generic-session';
import rethinkdbdash from 'rethinkdbdash';

const sessionStore = new ReSession({
  connection: rethinkdbdash({host: 'localhost', port: 28015, db: 'session'}),
  browserSessionsMaxAge: 5000,
  db: 'session',
  table: 'sessions'
});
sessionStore.setup();
export default convert(session({
  store: sessionStore
}));

koa-resession depends on rethinkdbdash or the default rethinkdb node.js driver. In addition, it is built for use with koa-generic-session. This project is based off of
koa-generic-session-rethinkdb. Unfortunately that project seems unmaintained and has a dependency on co due to its usage of generators.

Session information is made available on ctx.session.

License

MIT

ToDo

  • Finish writing tests
  • Show a better example.
0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago