Last active
November 23, 2020 10:00
-
-
Save egoing/06873382ecbe3f7af3f7fa0df80bc7ba to your computer and use it in GitHub Desktop.
AWS API Gateway - Lambda 예제
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def lambda_handler(event, context): | |
return { | |
'statusCode': 200, | |
'headers': { | |
"Content-Type": "text/html" | |
}, | |
'body': """ | |
<h1>Hello WEB</h1> | |
I love web | |
""" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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