我有 api api.demo
其结构如下
api.demo
/service1:
GET /test1
GET /test2
...
/service2
GET /test1
GET /test2
...
我有两个单独的文件夹service1、service2
每个都有自己的 serverless.yml 文件
当我部署时,它会在 api 网关中创建两个单独的 api,如下所示
api.demo(id1)
/service1:
GET /test1
GET /test2
...
api.demo(id2)
/service2
GET /test1
GET /test2
如何更新 service2 以采用相同的 api 端点 api.demo(id1)?
我怎样才能实现这个目标? 任何指示都会有帮助。
最佳答案
只需使用自定义域名:http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html
您可以将基本路径映射到 API,这样您就可以将 /service1
映射到第一个 API,将 /service2
映射到第二个 API。客户端将访问自定义域名,而不是我们提供的默认 execute-api
端点。
关于node.js - 无服务器 : Deploy to same api from different yml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45453680/