Skip to content

Latest commit

 

History

History
executable file
·
58 lines (40 loc) · 1.42 KB

README.md

File metadata and controls

executable file
·
58 lines (40 loc) · 1.42 KB

Serverless API Example

A very basic Price API template for building simple Lambda functions in NodeJs using the Serverless Framework.

Setup and Installation

AWS

Node and Serverless framework

Setup the code

  • Clone this repo
  • Launch a terminal in the root folder
  • Install all dependencies:
$ yarn install
$ yarn dynamodb-install

Running the code

Run locally (browse to http://localhost:3000 to try the API)

$ yarn runlocal

Running unit tests:

$ yarn test

Running integration tests (requires running server; yarn runlocal in other window):

$ yarn itest

Play with offline DynamoDB: http://localhost:8001/shell/

Deploying to AWS

$ yarn deploy

Remote tail of lambda functions running in AWS:

$ yarn taillog <functionName>

Note: The command serverless can be used interchangeably with sls for brevity.