Giter VIP home page Giter VIP logo

connect-dynamodb's Introduction

Connect DynamoDB

connect-dynamodb is a DynamoDB session store backed by the aws-sdk

Installation

  $ npm install connect-dynamodb

Options

  • client An existing AWS DynamoDB object you normally get from new AWS.DynamoDB()
  • AWSConfigPath Optional path to JSON document containing your AWS credentials (defaults to loading credentials from environment variables)
  • AWSRegion Optional AWS region (defaults to 'us-east-1')
  • table Optional DynamoDB server session table name (defaults to "sessions", currently the hash key has to be id - see issue #14)
  • prefix Optional key prefix (defaults to "sess")
  • reapInterval Optional - how often expired sessions should be cleaned up (defaults to 600000)

Usage

var options = {
	// Name of the table you would like to use for sessions.
	// Defaults to 'sessions'
  	table: 'myapp-sessions',

	// Optional path to AWS credentials (loads credentials from environment variables by default)
  	// AWSConfigPath: './path/to/credentials.json',
  
  	// Optional. How often expired sessions should be cleaned up.
  	// Defaults to 600000 (10 minutes).
  	reapInterval: 600000
};

var connect = require('connect'),
	DynamoDBStore = require('connect-dynamodb')(connect);
connect()
	.use(connect.cookieParser())
	.use(connect.session({ store: new DynamoDBStore(options), secret: 'keyboard cat'}))

Or with express

DynamoDBStore = require('connect-dynamodb')(express);
var app = express(
	express.cookieParser(), 
	express.session({ store: new DynamoDBStore(options), secret: 'keyboard cat'})
);

Contributors

Some people that have added features and fixed bugs in connect-dynamodb other than me.

Thanks!

License

connect-dynamodb is licensed under the MIT license.

Donations

I made this in my spare time, so if you find it useful you can donate at my BTC address: 1K9EtkuWURtBMqeAUxRiQGmf8RQ7DmJ2TR. Thank you very much!

connect-dynamodb's People

Contributors

kristian-ackar avatar bryce-larson avatar ericabouaf avatar roylines avatar

Watchers

Yi Wang avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.