Add route, Update workflow
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

This commit is contained in:
Ittipat Lusuk 2025-08-07 14:54:19 +07:00
parent f1b14ac7ea
commit 296c006fd9
4 changed files with 96 additions and 26 deletions

20
routes/health.js Normal file
View 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;