AWS Lambda(八)---用API Gateway

1.新建lamda function,选择python,使用代码如下,之后save,然后action下拉框依次执行publish和alias

import json

print('---Loading function---')


def lambda_handler(event, context):
    # print("Received event: " + json.dumps(event, indent=2))

    return {
        "statusCode": 200,
        "body": json.dumps({
            'message': 'Your code is working!'
        })
    }

2. 创建一个新的API Gateway

3. 

发布了140 篇原创文章 · 获赞 80 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/daiqinge/article/details/103329637
今日推荐