Understanding API Gateway
Welcome to the API Gateway guide! Let's learn about this important service that connects your arcade cabinet to your Lambda function.
What is API Gateway? 
Think of API Gateway as a smart receptionist for your arcade system:
- It receives requests from arcade cabinets
- Routes them to the right Lambda function
- Handles security and authentication
- Manages multiple connections
- Tracks usage and performance
Real World Example
Imagine a hotel front desk:
- Guests (arcade cabinets) arrive with requests
- The receptionist (API Gateway) checks their ID
- Then directs them to the right room (Lambda function)
- Keeps track of who's visiting
- Makes sure everything runs smoothly
Why Do We Need It? 
API Gateway is essential because it:
- Creates a stable URL for your API
- Manages security and access
- Handles multiple requests at once
- Provides usage metrics
- Stays within AWS free tier
Free Tier Benefits
API Gateway's free tier includes:
- 1 million API calls per month
- Built-in DDoS protection
- Request validation
- Response caching
API Gateway Concepts 
1. Endpoints
These are the URLs your arcade cabinet will use:
/status
- Check if system is running/create-payment-link
- Generate QR codes/addCredit
- Process payments/gameover
- Handle game completion
2. Methods
Different types of requests:
- GET - Retrieve information
- POST - Send information
- PUT - Update information
- DELETE - Remove information
3. Stages
Different versions of your API:
- Development - For testing
- Production - For real use
- Custom stages - For special needs
4. Integrations
How API Gateway connects to Lambda:
- Proxy integration - Passes everything through
- Custom integration - More control but complex
Security Features 
API Gateway protects your system with:
-
Authentication
- API keys
- IAM roles
- Custom authorizers
-
Throttling
- Rate limiting
- Burst limiting
- Per-client limits
-
Monitoring
- Request logging
- Error tracking
- Usage metrics
Next Steps 
Now that you understand API Gateway:
- Set up your own API Gateway
- Configure security settings
- Test the integration
Continue to API Gateway Setup → Back to Lambda Setup
Keep Learning
- Explore API Gateway dashboard
- Read CloudWatch logs
- Test different configurations