Initial commit

This commit is contained in:
2026-08-30 15:23:57 +02:00
commit dab5679098
1293 changed files with 240952 additions and 0 deletions
@@ -0,0 +1,25 @@
// variables
const services = { start: {}, stop: {}, restart: {}, status: {} };
const serviceNames = ['mysql','websocket','logger','scheduler'];
// dynamic manager
['start', 'stop', 'status'].forEach(action => {
serviceNames.forEach(name => {
services[action][name] = async () => {
const file = `./${name}/${action}.js`;
const func = require(file);
return await func();
};
});
});
// restart function
serviceNames.forEach(name => {
services.restart[name] = async () => {
await services.stop[name]();
await services.start[name]();
};
});
// function export
module.exports = services;