2 Building your first serverless API

 

Chapter 2 from Serverless Applications with Node.js by Slobodan Stojanovic and Aleksandar Simovic

This chapter covers

  • Creating and deploying an API using Claudia
  • How Claudia deploys an API to AWS
  • How API Gateway works

The main goal of this chapter for you is to build your first serverless API with Claudia and deploy it to AWS Lambda and API Gateway. You’ll also see the differences between a traditional and a serverless application structure and gain a better grasp of Claudia as you learn what Claudia is doing under the hood. To get the most from this chapter, you should understand the basic concepts of serverless described in chapter 1.

2.1 Assembling pizza ingredients: building the API

Your Aunt Maria is happy and grateful that you are going to help her get back on her feet. She even made you her famous pepperoni pizza! (Try not to be hungry at this moment!)

Aunt Maria already has a website, so you will build a back-end application—more precisely, an API—to enable her customers to preview and order pizzas. The API will be responsible for serving pizza and order information, as well as handling pizza orders. Later, Aunt Maria would also like to add a mobile application, which would consume your API services.

2.2 How Claudia deploys your API

2.3 Traffic control: How API Gateway works

2.4 When a serverless API is not the solution

2.5 Taste it!

Summary