Connect PostgREST Session
If you use PostgREST to talk to your database and you need session store, this is the module for you.
Used https://github.com/voxpelli/node-connect-pg-simple as a template for this,
A simple, minimal PostgREST session store for Express/Connect
Installation
npm install connect-postgrest-session
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:
psql mydatabase < node_modules/connect-postgrest-session/table.sql
Or simply play the file via a GUI, like the pgAdminIII queries tool.
Usage
Examples are based on Express 4.
Simple example:
var session = ; var SessionPostgrestStore = session var sessionStore = baseUrl: configpostgrestbaseUrl app;
Advanced example showing some custom options:
var pg = var session = var SessionPostgrestStore = session app
Express 3 (and similar for Connect):
var express = ; var SessionPostgrestStore = session var sessionStore = baseUrl: configpostgrestbaseUrl app;