0

我将 Node.js 用于 AWS Lambda + API Gateway API。

我有多个 Lambda 函数,每个函数都提供不同的响应格式,因为它集成了多个第三方 SDK,如 Stripe/DynamoDB 等。

有什么方法可以为下面的所有功能获得共同的响应?

{
  "success" : true,
  "data" : { RESPONSEFROMLAMBDA },
  "messages" : null,
  "code" : 200,
  "description" : "OK"
}
4

1 回答 1

1

The third-party services your Lambda functions are using shouldn't have any bearing on the response format. You just need to update all the API Gateway endpoints to use a mapping template with this format.

于 2017-08-24T14:01:39.847 回答