connect-aerospike is an Aerospike session store backed by aerospike-client-nodejs.
$ npm install connect-aerospike2
connect-aerospike was already taken. I didn't check before writing this one. They're pretty much the same except the current connect-aerospike (as of this commit) has some console.log statements in it and no docs on namespace and set settings (although it supports it)
Use express-session
instead of the default connect session
middleware.
$ npm install express-session
An Aerospike client is required. An existing client can be passed directly using the client
param or make a new one with hosts or host/port.
client
A configured, but not connected, aerospike clienthosts
A list of Aerospike server [{addr:'127.0.0.1',port:3000}]host
A single Aerospike host (def: 127.0.0.1)port
A single Aerospike port for the host (def: 3000)
The following additional params may be included:
ttl
Aerospike session TTL (expiration) in seconds (def: 86400)ns
Namespace to use (def: store_session)set
Set to use (def: session)prefix
Key prefix defaulting to "sess:"
Pass the express-session
store into connect-aerospike
to create a AerospikeStore
constructor.
var session = require('express-session');
var RedisStore = require('connect-aerospike2')(session);
app.use(session({
store: new AerospikeStore(options),
secret: 'keyboard cat'
}));
MIT