0.1.1 • Published 2 years ago

aws-apigateway-controller v0.1.1

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

aws-apigateway-controller

Simple handling of requests and responses within AWS API Gateway Lambda Proxy integrations running NodeJS 8.10.

Installation

npm install --save aws-apigateway-controller

Usage

NodeJS

const { Controller, Request, Response } = require('aws-apigateway-controller');

module.exports.handler = (event, context) => {

  return Controller.handle(event, context, (request) => {

    return new Response(200, `Executed handler for ${request.method} ${request.path} successfully.`);

  });

};

Typescript

Be sure to have run npm install --save-dev @types/aws-lambda @types/node to have the required types available.

import { APIGatewayProxyEvent, APIGatewayEventRequestContext } from 'aws-lambda'
import { Controller, Request, Response } from 'aws-apigateway-controller';

export async function handler(event: APIGatewayProxyEvent, context: APIGatewayEventRequestContext) {

  return Controller.handle(event, context, (request: Request) => {

    return new Response(200, `Executed handler for ${request.method} ${request.path} successfully.`);

  });

}
0.1.1

2 years ago

0.1.0

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.8

5 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago