The Aerospike Express Session Store is an implementation of the Express.js session store that uses Aerospike as the persistence layer for sessions. The session middleware for Express is provided by the session-express module. Aerospike DB is a high-performance NoSQL key-value store: www.aerospike.com.
$ npm install aerospike-session-store
express-session store into
aerospike-session-store to create an
AerospikeStore constructor. Then use that constructor to create a new store
const session =const AerospikeStore = sessionvar app =app
The session store requires an Aerospike Client instance to connect to the DB
cluster. An existing client instance can be passed in using the
option. Otherwise, the session store will create it's own client instance. The
Aerospike session store can be initialized with a number of optional
client- An existing Aerospike client instance that the session store should use instead of creating it's own instance.
namespace- The Aerospike namespace to be used for session storage. (default: 'test')
set- The Aerospike set name used when creating session records. (default: 'express-session')
ttl- Time-to-live in seconds for the session records created in the Aerospike db. If not specified, the ttl will be determined based on the
maxAgeof the session cookie, if any. Set
ttlto zero to disable usage of ttl. However, note that a default ttl at the namespace level might still apply.
mapper- A custom data mapper to convert session objects to/from a format suitable for storage in an Aerospike record. By default, the
JSONmodule is used to serialize session objects to/from JSON format.
Additional options are passed on to the Aerospike client when creating a new
client instance (i.e. unless the
client paramter is used.) Please refer to
the client's API
documentation for a
detailed list of supported paramters.
The Aerospike Express Session Store is made availabled under the terms of the Apache License, Version 2, as stated in the file LICENSE.
Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.