使用无服务器框架时更改 API 网关名称

Change API Gateway Name when using Serverless Framework

无服务器框架使开发人员可以非常轻松地创建连接到 lambda 函数的 API 网关。像这样

hello:
  name: hello-handler
  description: blablabla
  handler: /lambda-functions/hello-handler.handler
  role: HelloRole
  package:
    include:
      - lambda-functions/hello-handler.js
  events:
    - http: GET hello

我的问题是如何更改将要创建的 API 网关的名称?

基于 doc,这应该可以解决问题。

provider:
  ...
  apiName: custom-api-name # Use a custom name for the API Gateway API