2
0
镜像自地址 https://github.com/cderche/greenlock-challenge-s3 已同步 2025-05-10 23:46:31 +00:00
2019-05-09 12:25:25 +01:00

14 行
528 B
JavaScript

const path = require("path");
module.exports.remove = (opts, options, s3) => {
let challengeKey = path.join(options.directory, opts.challenge.token);
console.log("remove", challengeKey);
return s3.deleteObject({ Key: challengeKey, Bucket: options.bucketName }).promise().then(function (data) {
console.log("Successfully deleted challenge.");
return data;
}).catch(function (err) {
console.error("There was an error deleting your challenge: ", err.message);
throw err;
});
};