Skip to content

This project consists on a nodejs lambda connected to API gateway and dynamodb.

License

Notifications You must be signed in to change notification settings

Santos-Luis/lambda-rest-api

Repository files navigation

ci-tests Actions Status

Lambda Rest Api

The project consists on a nodejs lambda connected to API gateway and dynamodb, using serverless to deployment process

Stack requirements

Installation & development

  • We use serverless offline and dynamodb local, so we can run the lambda in local environment.

  • If you don't have JRE installed, we provide a docker to run the local environment. In the following steps it will be marked either (docker) or (JRE), so ignore the ones you are not following

  • Install dependencies

  npm install
  • Run on development mode (JRE)
  npm run install-dynamodb-local
  npm start
  • Run on development mode (docker)
  docker-compose up --build
  • Load fixtures (optional)
  npm run migrations
  • We also provide a simple postman collection that you can import, so it's easier to make the API requests

Route details

Models

Test

  • We are following the standard of writing tests in the same folder of the file itself. This means if you are going to write a test for entityCreate.js you should create a file named entityCreate.spec.js.

  • To run the all the tests:

  npm test

Deploy

  • We are using serverless to both deploy and define the aws resources. So you need a user/role that has permissions to:

    • create a S3 bucket to place the deployment files;
    • create a dynamodb bucket;
    • create a lambda and link it to cloudwatch;
  • Since all the resources are defined in the serverless.yml you just need to run

  npm deploy

About

This project consists on a nodejs lambda connected to API gateway and dynamodb.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published