Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 919aa48

Browse files
committed
Fix main.js for node10
1 parent e3723d0 commit 919aa48

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

infra/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rec
2222
function-unsplash =
2323
pkgs.runCommand "build-lambda" {}
2424
''
25-
cp ${pkgs.wai-lambda.wai-lambda-js-wrapper} main.js
25+
cp ${./main.js} main.js
2626
# Can't be called 'main' otherwise lambda tries to load it
2727
cp "${unsplashProxy}/bin/unsplash-proxy" main_hs
2828
mkdir $out

infra/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ exports.handler = function(event, context, callback) {
8989

9090
// Clean up the directory and finally reply
9191
console.log("cleaning up");
92-
fs.unlink(responseFile, (err) => {
93-
if (err) throw err;
94-
fs.rmdir(responseDir);
95-
});
92+
fs.unlinkSync(responseFile);
93+
fs.rmdirSync(responseDir);
9694
callback(null, response);
9795
}
9896
});

0 commit comments

Comments
 (0)