Closed sixtatami closed 7 years ago
ok, got it: if I use this in the serverless.yaml, everythng works like a charm:
- http:
path: graphql
method: post
cors: true
integration: lambda
response:
headers:
Access-Control-Allow-Origin: "'*'"
cheers a
Had the same issue. With these corrections it worked. Thanks
Hi Nik, we talked on Gitter.
what did not work for me:
if I run the code exactly as you provided I get following error:
what I tried:
based on https://serverless.com/framework/docs/providers/aws/events/apigateway/ at # Enabling CORS with the Lambda Integration Method it is not needed to define Access-Control-Allow-Methods, as this is set automatically.
I did delete following from the serverless.yaml:
then it deploys as described in your readme.
However, now my browser throws a:
Now I was wondering if I should include "'Access-Control-Allow-Origin': '*'" in the returned headers. However apparently this is only needed with a proxy setup.
Well I am bit lost here.
Maybe it is something different I have overlooked that kept my from deploying in the first place?
Thanks a lot for your help.
Cheers Andreas
one more thing: it might be good to say briefly in the readme that the AWS Command line tool is needed to be installed.