1.0.0 • Published 7 years ago

lambda-microservice-router v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

lambda-router

  1. Install lambda-router using npm:
npm install lambda-microservice-router --save
  1. 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});
  }
});
  1. Done!