@unito/integration-sdk 2.2.0 → 2.2.1

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.
@@ -1006,7 +1006,7 @@ class Integration {
1006
1006
  * @param options The {@link Options} to configure the Integration instance. Can be used to override the default port.
1007
1007
  */
1008
1008
  constructor(options = {}) {
1009
- this.port = options.port || 9200;
1009
+ this.port = options.port || (process.env.PORT ? parseInt(process.env.PORT, 10) : 9200);
1010
1010
  this.handlers = [];
1011
1011
  }
1012
1012
  /**
@@ -42,7 +42,7 @@ export default class Integration {
42
42
  * @param options The {@link Options} to configure the Integration instance. Can be used to override the default port.
43
43
  */
44
44
  constructor(options = {}) {
45
- this.port = options.port || 9200;
45
+ this.port = options.port || (process.env.PORT ? parseInt(process.env.PORT, 10) : 9200);
46
46
  this.handlers = [];
47
47
  }
48
48
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Integration SDK",
5
5
  "type": "module",
6
6
  "types": "dist/src/index.d.ts",
@@ -53,7 +53,7 @@ export default class Integration {
53
53
  * @param options The {@link Options} to configure the Integration instance. Can be used to override the default port.
54
54
  */
55
55
  constructor(options: Options = {}) {
56
- this.port = options.port || 9200;
56
+ this.port = options.port || (process.env.PORT ? parseInt(process.env.PORT, 10) : 9200);
57
57
  this.handlers = [];
58
58
  }
59
59