ca98am79 / connect-dynamodb

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

Enable the option of DynamoDB Local #17

Closed ryanjohnston closed 10 years ago

ryanjohnston commented 10 years ago

If a developer specifies 'dynamodb-local' as the region in their config, use the DynamoDBLocal tool instead of the actual live service. The DynamoDBLocal tool runs, by default, at localhost:8000. This enables offline development.

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html

ca98am79 commented 10 years ago

Thanks - I've been meaning to set this up. I'll look over this in the next few days

ca98am79 commented 10 years ago

Not sure if it is best to add this option, since you should be able to just create the local client object beforehand and then pass it in, for example (I haven't yet tested this):

AWS.config.sslEnabled = false;
var ep = new AWS.Endpoint('http://localhost:8000');
var client = new AWS.DynamoDB({endpoint: ep});
client.endpoint.hostname == 'http://localhost:8000';

var connect = require('connect'),
    DynamoDBStore = require('connect-dynamodb')(connect);
connect()
    .use(connect.cookieParser())
    .use(connect.session({ store: new DynamoDBStore({'client': client}), secret: 'keyboard cat'}))
ryanjohnston commented 10 years ago

I think your suggestion is better. That is definetly the cleaner way to add the local client connect.