AWS API Gateway with Angular

前端 未结 5 1772
孤街浪徒
孤街浪徒 2021-01-02 19:10

Has anyone gotten the AWS API Gateway to work with an Angular.js front-end? I have a lambda function that\'s exposed via a POST method in the API Gateway. I set up the hea

5条回答
  •  一生所求
    2021-01-02 19:40

    Api Gateway team here.

    Hopefully by now you've checked out the new 'Enable CORS' feature in the console. Even if your dev workflow is outside the console, you could quickly setup a test API and look at the header configurations that the console sets up for you, then copy those to your Swagger def or whatever solution you've come up with.

    The docs guide should still apply in either case. You'll need the 3 headers: Access-Control-Allow-Methods, Access-Control-Allow-Origin, and Access-Control-Allow-Headers. The values of these will depend on your API.

    If you'd like to send me the API resource you're trying to invoke, I can take a look from our side.

提交回复
热议问题