spee.ch/server/controllers/api/claim/publish/deleteFile.js

14 lines
313 B
JavaScript
Raw Normal View History

const logger = require('winston');
const fs = require('fs');
const deleteFile = (filePath) => {
fs.unlink(filePath, err => {
if (err) {
return logger.error(`error deleting temporary file ${filePath}`);
}
2018-08-20 21:27:52 +02:00
logger.info(`successfully deleted ${filePath}`);
});
};
module.exports = deleteFile;