0.1.0 • Published 6 years ago

lambda-event-router v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Lambda Event Router

A super lightweight router for use inside of lambda functions. This is useful inside of lambda functions which handle multiple request types and paths.

Does not require the use of other libraries and does not transform the event and context objects in any way.

Installation

npm install --save lambda-event-router

Example

const router = require('lambda-event-router').router();

router.get('/greeting', (event, context) => {
  context.succeed({
    statusCode: 200,
    body: JSON.stringify({ message: "Hello world" })
  });
});

module.exports.handler = router.route;

Supported methods

Currently supported HTTP methods include:

  • get
  • post
  • patch
  • put
  • delete
  • head
  • trace
  • options
0.1.0

6 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago