npm.io
2.0.6 • Published 6 years ago

aws-serverless-lite

Licence
MIT
Version
2.0.6
Deps
3
Size
37 kB
Vulns
0
Weekly
0
Stars
1

AWS SERVERLESS LITE

A simple library to manage routing in AWS lambda functions

Example Usage


index.js

import {
  handler as APIHandler,
  IAPIRoute,
  httpMethod,
} from 'aws-serverless-lite';

const routes: IAPIRoute[] = [
  {
    httpMethod: httpMethod.GET,
    path: 'projects',
    handlerFunction: getAll,
  },
  {
    httpMethod: httpMethod.GET,
    path: 'projects/:projectId',
    handlerFunction: ProjectService.update,
  },
];

exports.handler = async (event: any, _: any, callback: any) =>
  APIHandler(routes)(event, _, callback);

License


This project is licensed under the MIT license.

Keywords