0.1.12 • Published 4 years ago

@dontepsu/aws-lambda-router v0.1.12

Weekly downloads
24
License
MIT
Repository
github
Last release
4 years ago

AWS Lambda Router

A simple router for AWS Lambda functions and Serverless framework built with TypeScript.

Basic Usage

import { Router } from '@dontepsu/aws-lambda-router';

const router = new Router();
router.route({
  path: '/my-path',
  method: 'GET',
  handler: (event, context) => {
    return { success: true };
  };
});

Concat Routers

import { Router } from '@dontepsu/aws-lambda-router';

const usersRouter = new Router('/car');
usersRouter.get('/{id}', event => getCar(event.pathParameters.id))

const todoRouter = new Router('/todo');
todoRouter.post('', event => addTodo(JSON.parse(event.body)))

const router = new Router();
router
  .concat(usersRouter)
  .concat(todoRouter);

Error handling

Documentation to do. You can use Boom errors or errorDeclartion for routes. See code.

0.1.12

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.0

4 years ago

1.0.0-beta.1

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago