MENU

Fun & Interesting

Building a Serverless REST API with AWS Gateway to Python and AWS Lambda

Thulasi Tech In Creative 114 lượt xem 1 year ago
Video Not Working? Fix It Now

import json

def lambda_handler(event, context):
body = "Hello from Lambda!"
statusCode = 200
return {
"statusCode": statusCode,
"body": json.dumps(body),
"headers": {
"Content-Type": "application/json"
}
}
AWS API Gateway

AWS Lambda + API Gateway: No infrastructure to manage
Support for the WebSocket Protocol
Handle API versioning (v1, v2…)
Handle different environments (dev, test, prod…)
Handle security (Authentication and Authorization)
Create API keys, handle request throttling
Swagger / Open API import to quickly define APIs
Transform and validate requests and responses
Generate SDK and API specifications
Cache API responses

Comment