1.1.1 • Published 6 years ago

connect-cockroachdb-simple v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Connect CockroachDB Simple

A simple, minimal CockroachDB session store for Express/Connect

Build Status Coverage Status dependencies Status Known Vulnerabilities js-semistandard-style FOSSA Status

Installation

npm install connect-cockroachdb-simple

Once npm installed the module, you need to create the session table in your database. For that you can use the table.sql file provided with the module:

Usage

Example is based on Express 4.

Simple example:

var session = require('express-session');
var crdbSession = require('connect-cockroachdb-simple')(session);
var pg = require('pg');

app.use(session({
  store: new crdbSession({
    pg: pg,
    conString: YOUR_CONNECTION_STRING
  }),
  secret: process.env.FOO_COOKIE_SECRET,
  resave: false,
  cookie: { maxAge: 30 * 24 * 60 * 60 * 1000 } // 30 days
}));

Advanced options

View original fork here for advanced configuration.

License

FOSSA Status

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago