aws-serverless-lite
v2.0.6
Published
Run serverless applications and REST APIs using Node.js application framework on top of AWS Lambda and AWS API Gateway. This library is intended for use with Proxy method configurations.
Downloads
7
Readme
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.