0.1.1 • Published 3 years ago

aws-apigateway-controller v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
3 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

3 years ago

0.1.0

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 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