Add route, Update workflow
This commit is contained in:
parent
f1b14ac7ea
commit
296c006fd9
4 changed files with 96 additions and 26 deletions
20
routes/health.js
Normal file
20
routes/health.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
|
||||
const healthStatus = [
|
||||
"OK",
|
||||
"FAIL"
|
||||
]
|
||||
|
||||
router.get('/', function (req, res) {
|
||||
const jobs = CronJobs.getAllRunning;
|
||||
const data = [];
|
||||
|
||||
for (let [name, job] of jobs) {
|
||||
data.push({ name, status: healthStatus[0] });
|
||||
}
|
||||
|
||||
res.json({ data });
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Loading…
Add table
Add a link
Reference in a new issue