ca98am79 / connect-dynamodb

DynamoDB session store for Connect
http://ca98am79.github.com/connect-dynamodb/
MIT License
144 stars 66 forks source link

express 4 #19

Closed etiennea closed 10 years ago

etiennea commented 10 years ago

I have gotten it to work on express 4 by doing

var connect = require('connect'); var DynamoDBStore = require('connect-dynamodb')(connect);

is the the right way of doing it?

ca98am79 commented 10 years ago

as long as you are specifying DynamoDBStore as the session store, yes it should work. See the usage examples for more info.

etiennea commented 10 years ago

Except that in express 4 this does not work

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

but this breaks because on line 30 var Store = connect.session.Store; is not the correct way of storing things anymore.

etiennea commented 10 years ago

For anyone else looking at how to make this work var DynamoDBStore = require('connect-dynamodb')({session: session});

ca98am79 commented 10 years ago

thanks @etiennea - it would be great if you could issue a pull request to update the documentation