Remove backup download code

This commit is contained in:
Johannes Zellner
2017-04-22 22:17:29 +02:00
parent 8c011ea9b0
commit a7d7935451
8 changed files with 2 additions and 198 deletions
+2 -15
View File
@@ -2,12 +2,10 @@
exports = module.exports = {
get: get,
create: create,
download: download
create: create
};
var assert = require('assert'),
backups = require('../backups.js'),
var backups = require('../backups.js'),
BackupsError = require('../backups.js').BackupsError,
HttpError = require('connect-lastmile').HttpError,
HttpSuccess = require('connect-lastmile').HttpSuccess;
@@ -42,14 +40,3 @@ function create(req, res, next) {
next(new HttpSuccess(202, {}));
});
}
function download(req, res, next) {
assert.strictEqual(typeof req.params.backupId, 'string');
backups.getDownloadStream(req.params.backupId, function (error, result) {
if (error && error.reason === BackupsError.NOT_FOUND) return next(new HttpError(404, error.message));
if (error) return next(new HttpError(500, error));
result.pipe(res);
});
}