mirror of
https://github.com/cderche/greenlock-challenge-s3
synced 2025-05-10 15:36:33 +00:00
14 lines
528 B
JavaScript
14 lines
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;
|
|
});
|
|
}; |