couchdb-expression
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'
https: false // default value = false
});
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! ^-^