【问题标题】:Serverless: You're using the LAMBDA-PROXY in combination with request / response无服务器:您将 LAMBDA-PROXY 与请求/响应结合使用
【发布时间】:2017-02-13 21:50:26
【问题描述】:

有人可以帮忙解释一下这个警告信息的含义吗?

无服务器:警告!您将 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('$')

我不知道它在“请求/响应配置”中引用了什么。

【问题讨论】:

    标签: node.js serverless-framework


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2020-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-15
      • 2017-02-13
      • 1970-01-01
      相关资源
      最近更新 更多