Enable Cors Origin For amplify App

0

I am invoking Lambda function from amplify app. I wanted to set CORS for my API. Its different from the amplify URL. I have tried to enable Cors in API Gateway level. But It always default to all(*). How to set origin from code or amplify cli?

已提问 6 个月前826 查看次数
1 回答
0

I have a similar setup and one thing that worked well for me was using Powertools in lambda which makes handling CORS much easier.

You might still need to update settings on in api gateway, but that will depend on how you have configured api gateway. See here: https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-cors-console.html

已回答 6 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则