koa-resession

0.1.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i koa-resession

Weekly Downloads

0

Version

0.1.2

License

MIT

Last publish

Collaborators

  • strues