Skip to content

Instantly share code, notes, and snippets.

@egoing
Last active November 23, 2020 10:00
Show Gist options
  • Save egoing/06873382ecbe3f7af3f7fa0df80bc7ba to your computer and use it in GitHub Desktop.
Save egoing/06873382ecbe3f7af3f7fa0df80bc7ba to your computer and use it in GitHub Desktop.
AWS API Gateway - Lambda 예제
import json
def lambda_handler(event, context):
return {
'statusCode': 200,
'headers': {
"Content-Type": "text/html"
},
'body': """
<h1>Hello WEB</h1>
I love web
"""
}
import json
def lambda_handler(event, context):
print(event)
return {
'statusCode': 200,
'body': json.dumps({
"id":event['pathParameters']['id'],
"method":event['requestContext']['http']['method'],
"filter":event['queryStringParameters']['filter']
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment