lambda-microservice-router
v1.0.0
Published
A helpful tool for building a microservice router upon an AWS Lambda Function.
Downloads
6
Readme
lambda-router
- Install lambda-router using npm:
npm install lambda-microservice-router --save
- Create a route table in your
index.js
file:
exports.handler = require('lambda-microservice-router')({
'demoFn': (body, cb) => {
if (body.test !== 'test') {
return cb(new Error('Expected test==test'.));
}
return cb(null, {looks: 'Great!'});
},
'ping': (body, cb) => {
return cb(null, {pong: 1});
}
});
- Done!