Giter Club home page Giter Club logo

aws-lambda-node-postgresql-template's Introduction

AWS-Lambda-Node-PostgreSQL-Template

A template to create your AWS Lambda function using Node.js. It covers connecting to a PostgreSQL database, writing queries, fetching results, and sending a request to the desired endpoint.

  1. Create an 'index.js' file.
  2. Install the pg module using the command 'npm install pg' โ€“ this will generate the 'node_modules' folder and a 'package-lock.json' file.
  3. Define the exports.handler method to execute the code.
  4. Add and import all variables related to your server and database.
  5. Establish a connection with your database.
  6. Write a query and fetch the data.
  7. Disconnect from the database if access is no longer needed.
  8. Implement another method to send a request to your server's endpoint.
  9. Once you have finished writing the code, compress the contents of your project's root folder and upload the zip file to your Lambda function.
  10. Create a new scheduler in Amazon EventBridge to trigger this Lambda function.

aws-lambda-node-postgresql-template's People

Contributors

ayusharma-ctrl avatar

Watchers

 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.