Code Monkey home page Code Monkey logo

lambda-postgres-sample's Introduction

Sample Lambda function to fetch items from DynamoDB

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


Getting Setup

Installing project dependencies

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

Build steps

tsc  
zip -r postgres-lambda.zip ./www

Output HTTP response

{
  "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\"}}"
}

lambda-postgres-sample's People

Contributors

kranthige avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.