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
$ git clone https://github.com/RawSanj/aws-lambda-filter-chain.git
$ ./build.sh
Build and run locally
$ ./build.sh runLocally
Skip build and run locally
$ ./build.sh runLocally --skipBuild
Note: Install AWS SAM CLI and Docker to run aws lambda functions locally.
$ // Get All User
$ curl http://127.0.0.1:3000/user
$ // Post User
$ 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"}'
$ // Post Invalid Request i.e. username with special character
$ 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"}'
Apache License 2.0
Copyright (c) 2019 Sanjay Rawat