badmfck-api-server 4.1.20 → 4.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,6 +40,7 @@ const Liveness_1 = require("./routes/Liveness");
|
|
|
40
40
|
const Readiness_1 = require("./routes/Readiness");
|
|
41
41
|
const http_1 = __importDefault(require("http"));
|
|
42
42
|
const path_1 = __importDefault(require("path"));
|
|
43
|
+
const fs_1 = __importDefault(require("fs"));
|
|
43
44
|
const StatService_1 = require("./StatService");
|
|
44
45
|
const ExternalServiceEndpoint_1 = require("./external/ExternalServiceEndpoint");
|
|
45
46
|
const MonitorService_1 = require("./MonitorService");
|
|
@@ -84,6 +85,14 @@ exports.REQ_MONITOR_USERS = new badmfck_signal_1.Req(undefined, "REQ_MONITOR_USE
|
|
|
84
85
|
exports.REQ_DOC_USERS = new badmfck_signal_1.Req(undefined, "REQ_DOC_USERS");
|
|
85
86
|
exports.S_APP_STARTED = new badmfck_signal_1.default("S_APP_STARTED");
|
|
86
87
|
const activeServices = [];
|
|
88
|
+
const PACKAGE_VERSION = (() => {
|
|
89
|
+
try {
|
|
90
|
+
return JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(__dirname, "../../package.json"), "utf-8")).version ?? "unknown";
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return "unknown";
|
|
94
|
+
}
|
|
95
|
+
})();
|
|
87
96
|
async function Initializer(services) {
|
|
88
97
|
services.push(new StatService_1.StatService());
|
|
89
98
|
for (let i of services) {
|
|
@@ -98,7 +107,7 @@ async function Initializer(services) {
|
|
|
98
107
|
}
|
|
99
108
|
exports.Initializer = Initializer;
|
|
100
109
|
class APIService extends BaseService_1.BaseService {
|
|
101
|
-
version =
|
|
110
|
+
version = PACKAGE_VERSION;
|
|
102
111
|
options;
|
|
103
112
|
monitor = null;
|
|
104
113
|
started = new Date();
|