Aws lambda λ+;API网关:可选代理参数
我创建了一个Lambda/API网关函数,该函数将代理参数作为URL中的最终参数Aws lambda λ+;API网关:可选代理参数,aws-lambda,aws-api-gateway,serverless-framework,Aws Lambda,Aws Api Gateway,Serverless Framework,我创建了一个Lambda/API网关函数,该函数将代理参数作为URL中的最终参数 page: handler: handlers/website/getRenderedPage.get events: - http: method: get path: /content/{website}/{proxy+} cors: true request: paramet
page:
handler: handlers/website/getRenderedPage.get
events:
- http:
method: get
path: /content/{website}/{proxy+}
cors: true
request:
parameters:
paths:
proxy: true
website: true
根据定义,这就是我所经历的行为:
-->/content/site.com/blog/hello world
-->URL在浏览器中成功运行网站:site.com,代理:blog/hello world
-->/content/site.com
-->URL在浏览器中失败(缺少身份验证令牌,未找到aka API资源)网站:site.com
是否可以使
{proxy+}
参数可选?只需让它侦听两个事件即可
和/content/{website}
/content/{website}/{proxy+}
/
意味着需要将它们分开。如果改为调用/content/site.com/
会发生什么?