lucasvmigotto / node-aws-lambda

Testing AWS Lambda functions with TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-aws-lambda

Development

Get Started

  1. Copy and rename the file .env.example to .env:

    Customize the values as necessary

  2. Run the project API CLI:

    docker compose run --rm aws-lambda-api bash
  3. Install the dependencies:

    yarn
  4. Build the project to generate .js dist files:

    yarn build

Start the services

  • Start the API locally:

    docker compose up aws-lambda-api
  • Build the AWS Lambda Docker image and run the build project inside it

    1. Build the Docker image:

      docker compose build aws-lambda
    2. Build the Docker image:

      docker compose up aws-lambda
    3. Test with a simple request:

      curl \
          -X POST \
          -H 'Content-Type: application/json' \
          -d '{ "name": "Lucas" }' \
          http://localhost:3000/2015-03-31/functions/function/invocations

About

Testing AWS Lambda functions with TypeScript


Languages

Language:TypeScript 75.3%Language:Dockerfile 19.6%Language:Shell 5.0%