Skip to content

tnantoka/connect-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect SQLite

connect-sqlite is a SQLite session store, just copied connect-redis.

connect-sqlite support only connect >= 1.4.0.

Installation

  $ npm install connect-sqlite

Options

  • db='sessions' Database file & table name
  • dir='.' Direcotry to save '.db' file

Usage

var connect = require('connect')
 	  , SQLiteStore = require('connect-sqlite')(connect);

connect.createServer(
  connect.cookieParser(),
  connect.session({ store: new SQLiteStore, secret: 'your secret' })
);

with express

var SQLiteStore = require('connect-sqlite')(express);

app.configure(function() {
  app.set('views', __dirname + '/views');
  app.set('view engine', 'ejs');
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.cookieParser());
  app.use(express.session({
    store: new SQLiteStore,
    secret: 'your secret',
    cookie: { maxAge: 7 * 24 * 60 * 60 * 1000 } // 1 week
  }));
  app.use(app.router);
  app.use(express.static(__dirname + '/public'));
});

About

SQLite session store for connect and express.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published