connect-cockroachdb-simple

1.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i connect-cockroachdb-simple

Weekly Downloads

15

Version

1.1.1

License

MIT

Unpacked Size

35.8 kB

Total Files

17

Last publish

Collaborators

  • raymondflores