最佳答案
我试图用 AWS lambda 建立一个 hello world 示例,并通过 api 网关为其提供服务。我单击了“ Create a Lambda Function”,它设置了 api 网关并选择了 Blank Function 选项。我添加了 AWS gateway getting started guide上的 lambda 函数:
exports.handler = function(event, context, callback) {
callback(null, {"Hello":"World"}); // SUCCESS with message
};
The issue is that when I make a GET request to it, it's returning back a 502 response { "message": "Internal server error" }
. And the logs say "Execution failed due to configuration error: Malformed Lambda proxy response".