ggs-cron/routes/health.js
Ittipat Lusuk 296c006fd9
All checks were successful
CI for GGS-CRON / build-docker (push) Successful in 1m20s
CI for GGS-CRON / build-and-test (push) Successful in 3m14s
Add route, Update workflow
2025-08-07 14:54:19 +07:00

20 lines
No EOL
365 B
JavaScript

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;