I create backup-restore Meteor Package via mongodb-backup NPM package.
But I don’t want to use router to response the backup.tar file like this
res.writeHead(200, {
'Content-Type': 'application/x-tar' // force header for tar download
});
backup({
uri: 'uri', // mongodb://<dbuser>:<dbpassword>@<dbdomain>.mongolab.com:<dbport>/<dbdatabase>
collections: [ 'logins' ], // save this collection only
stream: res, // send stream into client response
});
You cannot use http server features like streams with Methods. Methods work with DDP messages over websocket in common. So it is more suitable to use some Router (connect) for the issue.