@routr/registry 2.0.8-alpha.30 → 2.0.8-alpha.32

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.
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.getConfig = void 0;
30
30
  /*
31
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
31
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
32
32
  * http://github.com/fonoster/routr
33
33
  *
34
34
  * This file is part of Routr
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schema = void 0;
4
4
  /*
5
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
5
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr
package/dist/envs.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const CONFIG_PATH: string;
2
+ export declare const ENABLE_HEALTHCHECKS: boolean;
package/dist/envs.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ENABLE_HEALTHCHECKS = exports.CONFIG_PATH = void 0;
4
+ /*
5
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster
7
+ *
8
+ * This file is part of Routr.
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const common_1 = require("@routr/common");
23
+ common_1.Assertions.assertEnvsAreSet(["CONFIG_PATH"]);
24
+ exports.CONFIG_PATH = process.env.CONFIG_PATH;
25
+ exports.ENABLE_HEALTHCHECKS = process.env.ENABLE_HEALTHCHECKS !== "false";
package/dist/errors.js CHANGED
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.InvalidSchemaConfiguration = void 0;
27
27
  /*
28
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
28
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
29
29
  * http://github.com/fonoster/routr
30
30
  *
31
31
  * This file is part of Routr
package/dist/request.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getPortFromAddress = exports.getHostFromAddress = void 0;
7
7
  /*
8
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
8
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr
package/dist/runner.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  /*
8
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
8
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr
@@ -26,14 +26,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  require("./tracer").init("dispatcher");
27
27
  const service_1 = __importDefault(require("./service"));
28
28
  const get_config_1 = require("./config/get_config");
29
- const common_1 = require("@routr/common");
30
29
  const logger_1 = require("@fonoster/logger");
30
+ const envs_1 = require("./envs");
31
+ const express_1 = __importDefault(require("express"));
32
+ const app = (0, express_1.default)();
33
+ const healthPort = 8081;
31
34
  const logger = (0, logger_1.getLogger)({ service: "registry", filePath: __filename });
32
- common_1.Assertions.assertEnvsAreSet(["CONFIG_PATH"]);
33
- const config = (0, get_config_1.getConfig)(process.env.CONFIG_PATH);
35
+ const config = (0, get_config_1.getConfig)(envs_1.CONFIG_PATH);
34
36
  if (config._tag === "Right") {
35
37
  (0, service_1.default)(config.right);
36
38
  }
37
39
  else {
38
40
  logger.error(config.left);
39
41
  }
42
+ if (envs_1.ENABLE_HEALTHCHECKS) {
43
+ app.get("/health", (_, res) => {
44
+ res.send("OK");
45
+ });
46
+ app.listen(healthPort, () => {
47
+ logger.info(`health check endpoint listening on port ${healthPort}`);
48
+ });
49
+ }
package/dist/sender.js CHANGED
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.sendRegisterMessage = void 0;
27
27
  /*
28
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
28
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
29
29
  * http://github.com/fonoster/routr
30
30
  *
31
31
  * This file is part of Routr
package/dist/service.js CHANGED
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  /*
16
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
16
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
17
17
  * http://github.com/fonoster/routr
18
18
  *
19
19
  * This file is part of Routr
package/dist/tracer.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.init = void 0;
7
7
  /*
8
- * Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
8
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/registry",
3
- "version": "2.0.8-alpha.30",
3
+ "version": "2.0.8-alpha.32",
4
4
  "description": "Sends trunks registrations and maintains their bindings",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -12,7 +12,8 @@
12
12
  "build": "tsc -b tsconfig.json"
13
13
  },
14
14
  "bin": {
15
- "run_registry": "dist/runner.js"
15
+ "run_registry": "dist/runner.js",
16
+ "healthcheck_registry": "dist/healthcheck.js"
16
17
  },
17
18
  "directories": {
18
19
  "src": "src",
@@ -34,9 +35,10 @@
34
35
  "@opentelemetry/sdk-trace-base": "^1.0.4",
35
36
  "@opentelemetry/sdk-trace-node": "^1.0.4",
36
37
  "@opentelemetry/semantic-conventions": "^1.0.4",
37
- "@routr/common": "^2.0.8-alpha.30",
38
- "@routr/processor": "^2.0.8-alpha.30",
38
+ "@routr/common": "^2.0.8-alpha.32",
39
+ "@routr/processor": "^2.0.8-alpha.32",
39
40
  "ajv": "^6.12.6",
41
+ "express": "^4.18.2",
40
42
  "fp-ts": "^2.11.8",
41
43
  "pb-util": "^1.0.3",
42
44
  "redis": "^4.0.4",
@@ -50,7 +52,8 @@
50
52
  "url": "https://github.com/fonoster/routr/issues"
51
53
  },
52
54
  "devDependencies": {
55
+ "@types/express": "^4.17.17",
53
56
  "@types/uniqid": "^5.3.2"
54
57
  },
55
- "gitHead": "6466c3e5262850c85dc6d15eec3e25f915a37667"
58
+ "gitHead": "cc7a72209d40052647c76a4e47517a0ea82ae9f7"
56
59
  }