ce
couchdb-expression
npm i couchdb-expression
ce

couchdb-expression

Express Session Store for CouchDB

by Saurabh M. Machave

1.5.4 (see all)License:MITTypeScript:Not FoundCategories:Express CouchDB
npm i couchdb-expression
Readme

couchdb-expression GitHub license

NPM

Build Status Coverage Status npm version Known Vulnerabilities Greenkeeper badge Maintainability Test Coverage

Installing

npm i couchdb-expression

Usage

A sample program:

const express = require('express');
const session = require('express-session');
const Expression = require('couchdb-expression')(session);

const store = new Expression({
  username: 'root',         // default value = 'admin'
  password: 'hello123',     // default value = 'password'
  hostname: 'localhost',    // default value = 'localhost'
  port: '5984',             // default value = 5984
  database: 'sessions'      // default value = 'sessions'
});

const app = express();

app.use(session({
  store: store,
  secret: 'meow',
  cookie: {
    maxAge: 3000,
  },
  resave: true,
  saveUninitialized: true,
}));

app.get('/', (req, res) => {
  console.log(req.session);
  res.send('hello world');
});

app.listen(3000);

Issues

Let me know if you face any issues, I would be happy to help! :) Post your issues here.

Happy Coding! ^-^