gpt4 book ai didi

node.js - 无服务器 : You're using the LAMBDA-PROXY in combination with request/response

转载 作者:搜寻专家 更新时间:2023-10-31 23:46:14 25 4
gpt4 key购买 nike

谁能帮忙解释一下这个警告信息是什么意思?

无服务器:警告!您在函数“indexPage”中将 LAMBDA-PROXY 与请求/响应配置结合使用。此配置在部署期间将被忽略。

我相信我了解 LAMDA-PROXY 部分。我很确定这是对 serverless.yml 的“集成”部分的引用:

 indexPage:
handler: reporting.index
memorySize: 128
timeout: 15
events:
- http:
path: /
method: post
integration: lambda-proxy
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')

我不知道“请求/响应配置”指的是什么。

最佳答案

如果您使用 lambda-proxy,您将通过 lambda 函数返回所有内容,而不是配置。它说它将忽略这部分:

response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')

如果您想在配置文件中定义请求/响应,您需要将集成从 lambda-proxy 更改为 lambda。

关于node.js - 无服务器 : You're using the LAMBDA-PROXY in combination with request/response,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41173775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com