according to the documentation json2xls
i should be able to do something like this:
router.route('/api2/course/session/attending')
.get(function (req, res) {
var jsonArr = [{
foo: 'bar',
qux: 'moo',
poo: 123,
stux: new Date()
},
{
foo: 'bar',
qux: 'moo',
poo: 345,
stux: new Date()
}];
res.xls('data.xlsx', jsonArr);
});
And then my client should download the xls
file
However this is not happening.
My headers are as follow:
But the response is empty.
Can anyone tell me what im doing wrong?