【发布时间】:2020-07-21 17:38:20
【问题描述】:
在阅读了无服务器文档和他们论坛中的一些帖子后,我注意到没有办法实现明确的条件归因。
我想根据阶段设置一个或其他值。
provider:
stage: ${opt:stage, 'production'}
custom:
domain: here's where the conditional should set one or the other value
所以,如果是生产阶段 custom.domain 应该保存值:www.mydomain.com,但如果是开发阶段,它应该保存 www-dev.mydomain.com
我发现了一些库/插件,例如 https://www.serverless.com/plugins/serverless-plugin-ifelse,但其中大部分都已过时。
您知道无需安装插件即可实现此目的的解决方法吗?
【问题讨论】:
标签: serverless-framework serverless