Serverless Cloud Functions with the Serverless Framework and AWS Lambda

Are you interesting in creating serverless cloud functions that allow one to:

  1. Have backend routes without a server.
  2. Use DynamoDB and S3 and other AWS Triggers.
  3. Grow your user base and scale up quickly.

If the answer to any of these questions is yes: you need to keep listening. Because I am about to deliver a podcast based upon this topic.

Using the Serverless framework one is able to create these cloud functions such as one would be able to in Google’s Firebase or MongoDB’s Realm. These “serverless” functions (meaning they do not require a server to use) allow one to deploy their backend functions to AWS Lambda.

Serverless functions are good for websites; desktop or mobile apps which are expecting a large user base and therefore are able to be scaled quickly. This means the application can go from having no users to billions of users without the server breaking. If the application uses serverless functions there should be little to no difference between the application having no users to the application having the previously aforementioned amount of users.

Step One: Navigate to the Serverless Website.

The first step in creating serverless cloud functions is to go to the Serverless website. This can be found at serverless.com. From there one is to create an account and then it will ask you for AWS keys. The AWS key id and AWS secret key id can be found in your AWS AIM section of the platform. Once you have generated new keys it is customary to migrate these keys to the serverless.com website.

From here one creates their first serverless application. There are many good boilerplates or starter templates that allow one to create their first serverless application. I have chosen the express starter template as nodejs and express is my favorite frameworks for backend development.

Once you have selected the starter template one is to navigate to the directory of their IDE or Terminal and install serverless with a

npm i -g serverless

From there one is to initialize their serverless project with a:

serverless init <id>

You are now free to develop your express backend with serverless! AWS Triggers can now be added to your application.

To deploy the application one is to write:

serverless deploy function -f <nameOfProject>

And whoop there it is: you have deployed your serverless function to AWS Lambda!

Feel free to tune into more of JavaScript News for tutorials and right now I have an Angular Course on this channel that will help you grow from No Stack to Full Stack! Feel free to give it a listen! Thanks!

Also you can listen to the full podcast here: https://anchor.fm/javascript-news/episodes/Serverless-Cloud-Functions-with-the-Serverless-Framework-and-AWS-Lambda-esqld6

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store