项目作者: RawSanj

项目描述 :
AWS Lambda Filters
高级语言: Java
项目地址: git://github.com/RawSanj/aws-lambda-filter-chain.git
创建时间: 2019-04-28T21:14:51Z
项目社区:https://github.com/RawSanj/aws-lambda-filter-chain

开源协议:Apache License 2.0

下载


aws-lambda-filter-chain

AWS Lambda Filter Chain provides a way to add filters similar to javax.servlet.Filter to the AWS Lambda Functions handling requests from API Gateway

Installation

Clone the Github repository

  1. $ git clone https://github.com/RawSanj/aws-lambda-filter-chain.git

Build library and sample API Gateway Lambda Function

  1. $ ./build.sh

Build & Run sample API Gateway Lambda Function locally

Build and run locally

  1. $ ./build.sh runLocally

Skip build and run locally

  1. $ ./build.sh runLocally --skipBuild

Note:
Install AWS SAM CLI and Docker to run aws lambda functions locally.

Test the sample lambda function locally

  1. $ // Get All User
  2. $ curl http://127.0.0.1:3000/user
  3. $ // Post User
  4. $ curl -X POST http://localhost:3000/user -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"userName": "john","fullName": "John Doe","age": 29,"company": "Example"}'
  5. $ // Post Invalid Request i.e. username with special character
  6. $ curl -X POST http://localhost:3000/user -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"userName": "john@example","fullName": "John Doe","age": 29,"company": "Example"}'

License

Apache License 2.0

Copyright (c) 2019 Sanjay Rawat