The serverless stack nowadays has many attractions, and we’re seeing more and more companies using Serverless framework and architecture to build and deploy web applications. The benefits are enormous — you don’t have to worry about uptime or manage any servers, leaving the developer to focus on the core business logic. It automatically scales depending on the load, and you can deploy applications fast. Finally, you pay-per-execution, which reduces costs because you only pay for the exact amount of time your server-side code runs by the millisecond.

This tutorial will show you how to build a secure REST API for a Notetaking react-redux application using MongoDB database as a service and following a Serverless approach using AWS Lambda, API Gateway, and the Serverless framework. AWS Lambda is an event-driven, serverless computing platform that executes a function in response to an event. It is basically a Docker container that gets spun up and runs the code. The underlying infrastructure and scaling it up or down to meet the event rate is managed, and you are only charged for the time your code is executed.


In Part 1, we are going to build the backend, and to go through this tutorial, you will need the following:

  1. AWS account
  2. Node.js — I’m using v14.16.0
  3. AWS CLI and  configure the profile with aws secret and access key.
  4. Postman for testing

Getting Started with the Serverless Framework

Install Serverless on your machine by running the following command, and this will install Serverless CLI to your system.

npm install serverless -g

#aws #react #nodejs #serverless #javascript

Build an API in Node.js using AWS, API Gateway, MongoDB, and Serverless
1.40 GEEK