Skip to content

jonatassaraiva/lamdba-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lamdba-mongodb

Sample project of ToDo List using Lambda AWS with Node.js, MongoDB, Express and Gateway API

Setup

1 - Install the NODE.JS v6.10.3

The current support AWS Lambda Node.js Runtime is v6.10.1.

To manage different versions of Node.js use the Node Version Manager - nvm.

After installing npm, install version 6.10.3 of Node.js:

nvm install v6.10.3

To use v6.10.3 on the terminal the project will be run, run the following command:

nvm use v6.10.3

2 - Install the dependencies

npm install

3 - Envirements to running local

3.1 Create file .env

> touch .env

3.2 Add env on file .env

MONGODB_CONNECTION_STRING=

4 Running local

> node scripts/run.debug.js

Deploy on AWS with Serverless Framework

Serverless is a toolkit for deploying and operating serverless architectures.

1 - Install Serverless Framework and config your credentials

> npm install -g serverless
> serverless config credentials --provider aws --key YOUR_KEY --secret YOUR_SECRET_KEY

2 - Create a Buckent to store all the deployment artifacts

3 - Deploy

> MONGODB_CONNECTION_STRING=YOUR_CONNECTION_STRING DEPLOYMENT_BUCKET=YOUR_DEPLOYMENT_BUCKET serverless deploy

Sample of cRUL request to API

Create a ToDo

Get ToDo List

Releases

No releases published

Packages

No packages published