Author: Kranthi Kiran
Created On: 29-Mar-2020
This is a sample lambda function code to fetch items from PostgreSQL based on 2 input parameters. a limit to specify the number of items to be pulled and nextKey value to offer pagination
This project uses NPM to manage software dependencies. NPM Relies on the package.json file located in the root of this repository. After cloning, open your terminal and run:
npm install
xcode-select --install ## ran this command to fix installation issues
tip: npm i is shorthand for npm install
install typescript and ts-node to compile TS files
npm i -g typescript
npm i -g ts-node
tsc
zip -r postgres-lambda.zip ./www
{
"statusCode": 200,
"headers": {
"Access-Control-Allow-Origin": "*"
},
"body": "{\"result\":{\"contractId\":1,\"contractName\":\"Aer Lingus CF6-80E EIN3\",\"engineModel\":\"CF6-80E\",\"year\":2020,\"qtr\":2,\"taskName\":\"Prev Run\"}}"
}