0

Need some help :) I have created a simple AWS API Gateway with a lambda backend just for trying it out. The only response is { "date": "2017-01-01" }, and the only method accepted is GET. When I test the API in the AWS Console it works fine. The response is as expected. But when I try to access it externally I get an Internal error message response. It kind of blows of course. Do I have to setup a elastic IP for this to work? I shouldn't have to add any roles to the API Gateway (I assume) since the role only declares what resources the API Gateway should be allowed to access? Or is there a "external access" role of some kind? Ot do I have to provide any HTTP-header when accessing the API?

3
  • Did you deploy API? Commented Aug 11, 2017 at 7:59
  • Look in CloudWatch, your lambda function will be logging there. Commented Aug 11, 2017 at 13:09
  • You might add Accept: application/json to the request you're sending. Commented Aug 11, 2017 at 21:52

1 Answer 1

1

Please enable CORS if you accesing API from an external domain. Please see the screenshot below, which shows how to enable CORS

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.