You cannot do multiple times for a single request.
But you could just combine the JSON and array data and fine-tune it.
App.set('view engine', 'ejs');
app.get('/', function(req, res) {
res.render('index.ejs', JSON.stringify({data2: arrayData, data1: JSONdata}))
});
Or just assign both variables to the same object and parse it with the render function
var returnVals= JSON.stringify({data2: arrayData, data1: jsonData});
source
share