diff options
author | Joe Robinson <joe@lc8n.com> | 2018-03-06 13:06:20 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2018-03-06 13:06:20 +0000 |
commit | f28d73818c1a101927408c50f693e136e4dff6d2 (patch) | |
tree | a853d61d0b8ef3ec23af30b718e571395f3d7dd2 | |
parent | a6d4523b9ebbbcbedff22201a619f3ba409722ad (diff) |
Update 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); + }); }; |