forked from external-repos/pa11y-dashboard
Add route for json download
This commit is contained in:
@@ -31,4 +31,19 @@ function route (app) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.express.get('/:id.json', function (req, res, next) {
|
||||||
|
app.webservice.task(req.params.id).get({}, function (err, task) {
|
||||||
|
if (err) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
app.webservice.task(req.params.id).results({}, function (err, results) {
|
||||||
|
if (err) {
|
||||||
|
return next(err);
|
||||||
|
}
|
||||||
|
task.results = results;
|
||||||
|
res.send(task);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user