diff options
Diffstat (limited to 'handler.js')
-rw-r--r-- | handler.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6,8 +6,10 @@ const AWS = require('aws-sdk'); // eslint-disable-line import/no-extraneous-depe const s3 = new AWS.S3(); module.exports.save = (event, context, callback) => { - console.log(event.Records[0].kinesis); - var url = new Buffer(event.Records[0].kinesis.data, 'base64').toString('utf8'); + event.Records.forEach(function(record) { + console.log(record.kinesis.data); + + var url = new Buffer(record.kinesis.data, 'base64').toString('utf8'); console.log(url); fetch(url) .then((response) => { @@ -26,4 +28,5 @@ module.exports.save = (event, context, callback) => { }).promise() )) .then(v => callback(null, v), callback); + }); }; |