From b54eb0cca911465ac0adc7e4a54a147febeaf05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Sun, 24 Jan 2021 00:30:28 +0000 Subject: [PATCH] New API entry that counts the number of pending tests --- lib/server/controllers/apiController.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/server/controllers/apiController.js b/lib/server/controllers/apiController.js index 3e057ec..a464cc6 100644 --- a/lib/server/controllers/apiController.js +++ b/lib/server/controllers/apiController.js @@ -224,10 +224,11 @@ var ApiController = function(app) { } }); - // Retrieve the list of all runs - /*app.get('/api/runs', function(req, res) { - // NOT YET - });*/ + // Counts all pending runs + app.get('/api/runs', function(req, res) { + res.setHeader('Content-Type', 'application/json'); + res.send(JSON.stringify({pendingRuns: queue.length()}, null, 2)); + }); // Delete one run by id /*app.delete('/api/runs/:id', function(req, res) {