O'Reilly logo

Full Stack Serverless by Nader Dabit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Getting Started with AWS Amplify

At the core of most applications is the data / API layer. This layer could look like many things. In the serverless world, this usually will be composed of a combination of an API endpoint and a serverless function. This serverless function could be doing some logic and returning data, interacting with a database of some kind, or even interacting with another API endpoint.

With Amplify there are 2 main ways of creating APIs:

  1. A combination of Amazon API Gateway and a Lambda function

  2. A GraphQL API connected to some type of data source (database, Lambda function, or HTTP endpoint)

API Gateway is an AWS service that allows you to create API endpoints and route them to different services, usually a Lambda function. In this chapter, you’ll learn how to create a Lambda function as well as an API Gateway endpoint and connect the two. When you make an API call, it will route the request through API Gateway, invoke the function, and return the response.

API with Lambda
Figure 2-1. API with Lambda

Once your API is created you then need a way to interact with it. Using the Amplify client you will be able to send requests to the endpoint using the Amplify API class. The API class allows you to interact with both GraphQL APIs as well as API Gateway endpoints.

In this chapter, you’ll create your first full stack serverless app that will interact with a serverless ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required