https://github.com/xeeo/nc-lambda-service
https://github.com/xeeo/nc-lambda-service
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/xeeo/nc-lambda-service
- Owner: xeeo
- Created: 2016-12-07T09:17:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-07T09:19:40.000Z (over 9 years ago)
- Last Synced: 2025-10-14T21:10:08.108Z (9 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nc-lambda-service
A simple wrapper over AWS Lambda.
## Usage
This library assumes that you deployed Lambda Functions through Serverless.
```javascript
'use strict';
const NcLambda = require('nc-lambda-service');
const lambdaService = new NcLambda();
lambdaService.configure({
accessKeyId : '',
secretAccessKey: '',
region : 'us-east-1',
environment : 'dev'
});
const userService = ncLambda.getService('service-user');
const params = {
key: 'value'
};
userService.invoke('create', prams)
.then(response => {
console.log(response);
});
```
* the Lambda function is "service-user-dev-create" and the service is a Serverless Service.
* the NCLambda is Singleton. This means you configure it once in a global config and when requiring it in other sub modules it's still configured. It uses nc-singleton.
Testing will follow.
That's it.