1

So I'm trying to write a POST method that triggers a lambda function which will in turn write to a DynamoDB database. The logic behind all of that seems fine, and I can invoke the lambda function when I make a POST request to the API through POSTMAN. However, when I try to do the same from my actual application, which doesn't currently have a domain, I get the error:

Type error: Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin

Since I don't have a domain I am developing using localhost:3000. Can I get this to work with API Gateway? I already have CORS setup with [*] as my list of domains, so this should be open to every domain.

Ryan Lee
  • 164
  • 1
  • 6
KSamra
  • 124
  • 1
  • 10
  • Have you enabled CORS on your API Gateway Resource? There's a checkbox you can use to enable it easily. – AlexK Nov 19 '18 at 08:54
  • Yes CORS is enabled. I'm wondering if it's an issue with using localhost:3000 as my origin. Like I said it works through Postman – KSamra Nov 19 '18 at 22:38

1 Answers1

0

Try to

change localhost to "lvh.me" which points to 127.0.0.1

or

edit your hosts file so that local.[mysite].com points to 127.0.0.1, then make your CORS file allow *.[mysite].com

check: stack

guzial
  • 121
  • 1
  • 3