admin管理员组文章数量:1319017
I have setup my API gateway and hooked it up to my lambda function
I set the url to {id} and want to pass this parameter into the lambda,
However even after trying multiple intergration requests using the default template and a custom one , the lambda still cant detect the paramters passed in the api gateway (id)
Ive tried assigning id to different parameters in my node js lambda function mapping it to path.params.id and other variables even tried the string query but it still isnt being detected in the lambda any ideas?
I have setup my API gateway and hooked it up to my lambda function
I set the url to {id} and want to pass this parameter into the lambda,
However even after trying multiple intergration requests using the default template and a custom one , the lambda still cant detect the paramters passed in the api gateway (id)
Ive tried assigning id to different parameters in my node js lambda function mapping it to path.params.id and other variables even tried the string query but it still isnt being detected in the lambda any ideas?
Share Improve this question asked Aug 19, 2018 at 21:22 xhawxhaw 311 gold badge1 silver badge2 bronze badges 2- 1 Can you share more details? For example the mapping template? – Alex Moore Commented Aug 19, 2018 at 21:27
- Do you pass it to a custom authorizer lambda before your business logic lambda? – maxwell Commented Aug 19, 2018 at 21:30
1 Answer
Reset to default 6Here's an example lambda function that pulls out an id
path parameter:
module.exports.get = (event, context, callback) => {
const { id } = event.pathParameters;
console.log("id", id);
};
You can also get query string parameters with event.queryStringParameters
.
A detailed example can be found in the AWS documentation.
本文标签: javascripthow to take url parameters from AWS API Gateway and input them into lambdaStack Overflow
版权声明:本文标题:javascript - how to take url parameters from AWS API Gateway and input them into lambda - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742052060a2418107.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论