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?

1 réponse
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

répondu il y a 6 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions