有人可以帮忙解释一下此警告消息的含义吗?

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

我相信我了解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/

10-09 17:55
查看更多