0.0.2 • Published 4 years ago

@jtviegas/entity-service v0.0.2

Weekly downloads
-
License
Unlicense
Repository
github
Last release
4 years ago

Build Status Coverage Status

entity-service

a generic crud service for entities

overview

Installation

npm install @jtviegas/entity-service

Usage

required environment variables

- region - aws region ( not mandatory, default: eu-west-1 )
- AWS_ACCESS_KEY_ID ( mandatory )
- AWS_SECRET_ACCESS_KEY ( mandatory )
- DYNDBSTORE_TEST_ENDPOINT ( not mandatory, for testing purposes )

code snippet example

let service = require('@jtviegas/entity-service');
let event = {
                httpMethod: 'GET'
                , pathParameters: {
                    entity: ENTITY
                    , app: APP
                    , env: ENV
                }
            };
service.handler(event, context, (e,d)=>{
    if(e)
        done(e);
    else {
        let r=JSON.parse(d.body);
        expect(r.length).to.equal(TEST_ITERATIONS);
        done(null);
    }
});

Tests

npm test

Contributing

just help yourself and submit a pull request