Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (scr.onInit && scr.onInit.toString().indexOf('next') > -1) {
scr.onInit(req, res, function(content) {
scr.req = req
console.log('next')
self.html = content
self.doRun(scr, [], function(result, res) {
if (type == 'json')
res.json(result)
else {
res.csv(result, 'output.csv')
}
}, res)
})
} else {
scr.onInit && scr.onInit(req, res)
scr.req = req
self.html = false
self.doRun(scr, [], function(result, res) {
if (type == 'json')
res.json(result)
else {
res.csv(result, 'output.csv')
}
}, res)
}
}
}
},
routes: function() {