1
6
|
2
4
如果在本地运行,则可以使用仅添加标头的环境变量。 下面是一个简单的Python示例,来自我拥有的处理函数:
这只适用于本地测试,当您部署到API网关时,CORs由API网关上的配置处理。 这个解决方案一直对我有效,直到我还向API添加了授权,使用了Cognito用户池,我目前正在尝试解决这个问题。 |
3
4
首先,您需要在模板.yml要在API网关中启用cors:
然后在lambda函数响应中
|
prime · 如何在AWS Lambda上构建无服务器框架和微服务 6 年前 |
TutuGeorge · 具有附加输入数据参数绑定的Azure函数 6 年前 |
iaforek · 如何使用无服务器域管理器插件根据阶段设置不同的域? 6 年前 |
iaforek · 在脱机启动无服务器时发生eNONT错误 7 年前 |
Kevin Smith · 使用Azure函数存储数据的最佳做法 7 年前 |