[英]How to pass event parameters to AWS Lambda function using API Gateway?
[英]How can we use the AWS lambda “event” (API Gateway) as a Readable stream?
我正在尝试将POST请求中的文件发送到AWS lambda并在一些处理后获得结果。 我想将请求正文用作可读流,如下面的示例中所述。
// AWS lambda (using the serverless framework)
module.exports.hello = (event, context, callback) => {
// pipe the request content to another stream (.pipe())
}
我可以在Express 中轻松完成相同的操作,但无法使用 AWS lambda 提供的事件对象。
// Express server
app.post('/endpoint', (req, res) => {
req.pipe(anotherStream)
})
AWS Lambda 旨在处理来自 AWS Api Gateway(或任何其他 Lambda 调用)的不同事件(作为对象提供)。 你可以做什么:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.