-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query parameters are not configured in the API Gateway #8
Comments
Have you check in the "Request Paths" section? That This is how the dashboard looks like for the apigateway example (https://github.com/jorgebastida/gordon/tree/master/examples/apigateway) |
You're right (obviously), the I read http://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-lambda.html and realized that I was missing the configuration for the Integration Request. I added this manually: The test in the API Gateway page passed. I deployed the API and it works with I have to figure out with piece of configuration I'm missing in gordon. I expected I had nothing to do and that declaring the parameter would setup the Integration Request too. |
I made further investigations. I cloned the gordon repository, moved to the examples/apigateway folder, changed the name of the bucket and deployed the example. That also doesn't configure the Integration Request. You can try I modified the example to print out the I added an explicit parameters definition:
(I switched to The AWS documentation hints that the With those lines
Unfortunately there is no detailed error message. All the examples that define parameters for the API Gateway don't use those parameters in the lambda functions. Could you give a working example of a lambda function that uses those parameters? Thanks. A final remark: in the spirit of convention over configuration (I remember your comment on HN) I think that we shouldn't even declare how to map parameters to The last two lines here shouldn't be needed:
|
I eventually realized that if I POST a JSON to an API Gateway URL it gets forwarded to the
That is totally OK for sending data. |
Just found this. @pmontrasio wondering if #117 is related to this? |
I have this in the settings.yml for an application that should only demonstrate how to read parameters from a GET query string or a POST body:
code.js is
echo '{"name": "Paolo"}' | gordon run greetings.index
works as expected. However it seems that theevents
object is always empty when I call through the API gateway:Actually looking into the AWS API Gateway there are no parameters defined for that method:
I'm probably missing some bits of configuration. I looked into the examples and the documentation, checked several alternatives (also POST instead of GET) but the parameter never gets to the function.
The text was updated successfully, but these errors were encountered: