A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/webcc/cassandra-store below:

webcc/cassandra-store: Implementation of the session storage in Apache Cassandra as express middleware.

Implementation of the session storage in Apache Cassandra as an extension of the express-session middleware. This version has been fully updated to ES6 and Node.js >= 10. For backwards compatibility, use older versions of the package.

$ npm install [-g] cassandra-store
{
    "table": "sessions",
    "client": null,
    "clientOptions": {
        "contactPoints": [ "localhost" ],
        "keyspace": "tests",
        "queryOptions": {
            "prepare": true
        }
    }
}

If client is null or undefined, a new Cassandra client will be created. Client options come from the Cassandra client driver (version 3.x).

To create the table in the Cassandra database, you need the execute the following CQL commands:

USE tests;

DROP TABLE IF EXISTS sessions;

CREATE TABLE IF NOT EXISTS sessions (
   sid text,
   session text,
   expires timestamp,
   PRIMARY KEY(sid)
);

To activate debugging, set the environment variable NODE_DEBUG:

$ export NODE_DEBUG=cassandra-store

See test/README.md

Usage within express:

const session = require("express-session");
const CassandraStore = require("cassandra-store");

app.use(session({
    store: new CassandraStore(options),
    ...
}));

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4