What is API Gateway?
API Gateway gives your code a public web address and handles the security and traffic that comes with it.
A Lambda function on its own has no URL. A browser or mobile app can't call it directly. Amazon API Gateway is the front door: it receives HTTPS requests from the internet, checks them, and forwards them to your backend (usually Lambda), then sends the response back.
API Gateway is a restaurant host. Guests (requests) arrive at the front. The host checks reservations (authentication), stops the room from overflowing (throttling), and walks each guest to the right table (route → backend). The kitchen (your Lambda) never deals with the crowd at the door.
What it handles for you
- HTTPS endpoints with TLS certificates managed for you
- Routing:
GET /notesgoes to one function,POST /notesto another - Authentication: JWTs, Amazon Cognito, IAM, or your own Lambda authorizer
- Throttling so a traffic spike or a misbehaving client can't overwhelm your backend
- CORS so browser apps on another domain can call you
- Stages like
devandprod, plus monitoring in CloudWatch
In our project
Across this site we build one small project, piece by piece: NoteSnap, an app where you upload a text note and get back an AI-written summary. Each service adds one part. API Gateway lets the NoteSnap web app fetch summaries with GET /notes/{id}.
- 1Client
Browser or mobile app
- 2API Gateway
Auth, throttle, route
- 3Lambda
Your code runs
- 4Response
JSON sent back
Key takeaways
- API Gateway is the HTTPS front door for your backend.
- It handles routing, auth, throttling, and CORS, so your code doesn't have to.
- The most common backend behind it is Lambda.
Check your understanding
Pick an answer to see the explanation.
1. Which of these does API Gateway NOT do for you?