Skip to content
This repository was archived by the owner on Oct 31, 2018. It is now read-only.

Commit 060bfe4

Browse files
jorritjpignata
authored andcommitted
1 parent 19e214b commit 060bfe4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dist/function.zip

61.7 KB
Binary file not shown.

lambda/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var Sharp = require('sharp');
55
var BUCKET = process.env.BUCKET;
66
var URL = process.env.URL;
77

8-
exports.handler = function(event, context) {
8+
exports.handler = function(event, context, callback) {
99
var key = event.queryStringParameters.key;
1010
var match = key.match(/(\d+)x(\d+)\/(.*)/);
1111
var width = parseInt(match[1], 10);
@@ -25,11 +25,11 @@ exports.handler = function(event, context) {
2525
Key: key
2626
}).promise()
2727
)
28-
.then(() => context.succeed({
28+
.then(() => callback(null, {
2929
statusCode: '301',
3030
headers: {'location': `${URL}/${key}`},
3131
body: ''
3232
})
3333
)
34-
.catch((err) => context.fail(err))
34+
.catch((err) => callback(err))
3535
}

0 commit comments

Comments
 (0)