使用 claudiajs 在 root 而不是 'latest' 中部署 Lambda
Deploy Lambda in root rather than in 'latest' with claudiajs
根据 claudiajs tutorial 和许多其他教程,默认情况下,它始终部署在 latest
文件夹中而不是根目录中。
有没有办法部署到根目录(即 https://8x7uh8ho5k.execute-api.us-east-1.amazonaws.com
),而不是部署到 latest
文件夹(即 https://8x7uh8ho5k.execute-api.us-east-1.amazonaws.com/latest
)?
我对Claudia.js不熟悉,我将从API网关的角度进行解释。 API 网关调用 URL 之后的 latest
值实际上是 API Gateway Stage. A stage
is used to deploy the changes made to the API Gateway's resources so that it is available when you hit the invoke URL. You can create multiple stages so as to maintain different versions of your API, say "dev" and "production". However, a stage is required and you cannot deploy changes to "root". The invoke URL 看起来像:
https://{restapi_id}.execute-api.{region}.amazonaws.com/{stage_name}/
如果您不想在调用 API 时指定舞台名称,您可以考虑使用 Custom Domain Names.
如果您想在使用 Claudia.js 部署 API 时更改阶段名称,请查看 Claudia 的文档以检查是否可行。
根据 claudiajs tutorial 和许多其他教程,默认情况下,它始终部署在 latest
文件夹中而不是根目录中。
有没有办法部署到根目录(即 https://8x7uh8ho5k.execute-api.us-east-1.amazonaws.com
),而不是部署到 latest
文件夹(即 https://8x7uh8ho5k.execute-api.us-east-1.amazonaws.com/latest
)?
我对Claudia.js不熟悉,我将从API网关的角度进行解释。 API 网关调用 URL 之后的 latest
值实际上是 API Gateway Stage. A stage
is used to deploy the changes made to the API Gateway's resources so that it is available when you hit the invoke URL. You can create multiple stages so as to maintain different versions of your API, say "dev" and "production". However, a stage is required and you cannot deploy changes to "root". The invoke URL 看起来像:
https://{restapi_id}.execute-api.{region}.amazonaws.com/{stage_name}/
如果您不想在调用 API 时指定舞台名称,您可以考虑使用 Custom Domain Names.
如果您想在使用 Claudia.js 部署 API 时更改阶段名称,请查看 Claudia 的文档以检查是否可行。