mycro-vogels
a dynamodb adapter (using vogels) for mycro
Install
npm install --save vogels mycro-vogels
Getting Started
- Make sure your aws credentials are available (environment variables, ec2 instance profile, or set manually)
- Define a connection
// in config/connections.js const vogelsAdapter = ; moduleexports = vogels: adapter: vogelsAdapter config: region: 'us-west-2'
- Define a model
// in app/models/post.js module { // name = 'post' const model = vogels; return model;};
- Use it
// in app/controllers/posts.js module { const Posts = mycromodelspost; return { Posts; } };
Configuration
All items (except for a 'driver' attribute) in the config object will be passed to vogels as is:
// in config/connections.jsconst AWS = ;const vogelsAdapter = ; moduleexports = // .. dynamo: adapter: vogelsAdapter { if processenvNODE_ENV === 'test' return driver: endpoint: 'http://localhost:8000' region: 'us-west-2' ; else return region: 'us-west-2' } // ..
Testing
run the tests
npm test
run coverage
grunt coverage
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
Copyright (c) 201 Ben Schnelle & Chris Ludden. Licensed under the MIT license.