0

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:

enter image description here

But the response is empty.

Can anyone tell me what im doing wrong?

Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364

0 Answers0