Skip to content

Commit

Permalink
Let's try compressing the data?
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalazar committed Sep 30, 2023
1 parent 8967fa0 commit 25d8446
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const AWS = require("aws-sdk");
const fs = require("fs");
const zlib = require("zlib");

exports.handler = async (event, context) => {
console.log(JSON.stringify(event));
Expand All @@ -16,7 +17,7 @@ exports.handler = async (event, context) => {
isBase64Encoded: false,
statusCode: 200,
headers: { "content-type": "application/json" },
body: JSON.stringify(JSON.parse(metadata.toString())),
body: JSON.stringify(zlib.gzipSync(metadata).toString("base64")),
};
} catch (e) {
console.log(JSON.stringify(e, ["name", "message", "stack"]));
Expand Down

0 comments on commit 25d8446

Please sign in to comment.