Skip to content

KamiMoon/aws-serverless-learning

Repository files navigation

Example Serverless Lambda DynamoDB REST API

Uses

Running locally

Requires:

  • Everything needed to run AWS SAM locally as described here.
  • Also that requires docker.
  • Install and run this DynamoDB image.
  • Create a docker network:
docker network create aws-local-network

The scripts use that network to connect the lambda docker container that SAM uses and DynamoDB container locally.

Start DynamoDB and populate it

bash dbstart.sh

See script that starts docker, starts already installed DynamoDB container, and runs node script to create table and populate it with data.

Run webpack

npm watch

Run Lambda locally

npm api

Running Unit Tests

npm test

Integration Tests

Requires that a local server running with DynamoDB up and populated. See above.

npm integration

Run proxy for mobile

npm proxy

Then use that IP address. Docker has problems using an IP address locally, so throw a proxy server up locally in front for things like testing locally with your React Native App.

Deploy lambda service

Use Code Pipeline etc as described here to automate depoyement when you push to a branch in GitHub/your repo.

TODOS

  • Config swtich db local/prod using like environmental variables.
  • Security and Auth/authorization.

About

Example Lambda DynamoB REST API for https://github.com/KamiMoon/react-native-movie

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published