Skip to content

Commit 7f59f23

Browse files
committed
Update Lambda Layer dependencies and function code
1 parent 95ad09d commit 7f59f23

12 files changed

+9
-2
lines changed

function/index.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let {createCanvas} = require("canvas");
22

3-
exports.handler = function(event, context, callback) {
3+
exports.handler = async (event) => {
44
let canvas = createCanvas(200, 200),
55
ctx = canvas.getContext('2d');
66

@@ -17,5 +17,12 @@ exports.handler = function(event, context, callback) {
1717
ctx.lineTo(50 + text.width, 102);
1818
ctx.stroke();
1919

20-
callback(null, '<img src="' + canvas.toDataURL() + '" />');
20+
return {
21+
statusCode: 200,
22+
headers: {
23+
'Content-Type': 'image/png'
24+
},
25+
body: canvas.toDataURL().replace(/data:image\/png;base64,/, ''),
26+
isBase64Encoded: true
27+
}
2128
}

function/lib/libcairo.so.2

-1.19 MB
Binary file not shown.

function/lib/libfreetype.so.6

-741 KB
Binary file not shown.

function/lib/libjpeg.so.62

-267 KB
Binary file not shown.

function/lib/libpango-1.0.so.0

-273 KB
Binary file not shown.

function/lib/libpangocairo-1.0.so.0

-55.5 KB
Binary file not shown.

function/lib/libpangoft2-1.0.so.0

-88 KB
Binary file not shown.

function/lib/libpixman-1.so.0

-670 KB
Binary file not shown.

function/lib/libpng12.so.0

-159 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)