The following callback function sends an empty file to the browser even though the file contains 'helloworld' on the server:
router.get('/Download', function(req, res) {
var fs = require('fs')
fs.writeFile('helloworld.txt', 'helloworld');
res.download('helloworld.txt');
})