mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Initial commit
This commit is contained in:
15
route/index.js
Normal file
15
route/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = route;
|
||||
|
||||
// Route definition
|
||||
function route (app) {
|
||||
app.express.get('/', function (req, res, next) {
|
||||
app.webservice.tasks.get(function (err, tasks) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
res.send(tasks);
|
||||
});
|
||||
});
|
||||
}
|
10
route/new.js
Normal file
10
route/new.js
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = route;
|
||||
|
||||
// Route definition
|
||||
function route (app) {
|
||||
app.express.get('/new', function (req, res) {
|
||||
res.send('Create a task');
|
||||
});
|
||||
}
|
15
route/task.js
Normal file
15
route/task.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = route;
|
||||
|
||||
// Route definition
|
||||
function route (app) {
|
||||
app.express.get('/:id', function (req, res, next) {
|
||||
app.webservice.task(req.params.id).get(function (err, task) {
|
||||
if (err) {
|
||||
return next();
|
||||
}
|
||||
res.send(task);
|
||||
});
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user