【问题标题】:How to deploy API Gateway on Serverless 1.X?如何在 Serverless 1.X 上部署 API Gateway?
【发布时间】:2017-04-25 13:09:44
【问题描述】:

从 Serverless 1.X 开始,我在 serverless.yml 或网络搜索结果中找不到 API 网关设置。 它只包含 lambda 设置,我将 Hello World 模板部署到我的 AWS,实际上只部署了 lambda。

如何在 Serverless 1.X 上部署和配置 API Gateway?

【问题讨论】:

    标签: amazon-web-services serverless-framework


    【解决方案1】:

    我自己找到了答案。

    这里写在文档里,

    https://serverless.com/framework/docs/providers/aws/events/apigateway/

    而且,我太粗心了,模板中注释掉了一些设置示例。

    这个 API Gateway 设置是这样写的:

    functions:
      hello:
        handler: handler.hello
        events:
          - http:
            path: hello
            method: get
    

    因此,API Gateway 部署设置是“functions=>events”设置的一部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-10
      • 1970-01-01
      • 1970-01-01
      • 2020-07-09
      • 1970-01-01
      • 2021-06-16
      • 2021-10-08
      相关资源
      最近更新 更多