@nwire/endpoint 0.13.0 → 0.13.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.
package/dist/endpoint.js CHANGED
@@ -406,7 +406,9 @@ export class EndpointBuilder {
406
406
  name: this.name,
407
407
  host: this.config.host ?? "0.0.0.0",
408
408
  port: dataPort,
409
- probePort: probesBound ? (this.config.probes?.port ?? 9_400) : undefined,
409
+ probePort: probesBound
410
+ ? (this.config.probes?.port ?? (Number(process.env.PROBE_PORT) || 9_400))
411
+ : undefined,
410
412
  });
411
413
  }
412
414
  return {
package/dist/lifecycle.js CHANGED
@@ -52,7 +52,10 @@ export async function attachLifecycle(opts) {
52
52
  };
53
53
  const healthCfg = {
54
54
  enabled: opts.health?.enabled ?? true,
55
- port: opts.health?.port ?? 9_400,
55
+ // Explicit config wins; else `$PROBE_PORT` (so the probe port is tunable
56
+ // without a code change — e.g. when :9400 is taken by another service);
57
+ // else the default. A non-numeric env value falls through to 9400.
58
+ port: opts.health?.port ?? (Number(process.env.PROBE_PORT) || 9_400),
56
59
  livenessPath: opts.health?.livenessPath ?? "/live",
57
60
  readinessPath: opts.health?.readinessPath ?? "/ready",
58
61
  checks: opts.health?.checks ?? [],
@@ -86,7 +89,7 @@ export async function attachLifecycle(opts) {
86
89
  const code = err.code;
87
90
  if (code === "EADDRINUSE") {
88
91
  console.warn(`[lifecycle] probe port :${healthCfg.port} already in use — probes disabled. ` +
89
- `Override with \`probes: { port: <other> }\` on endpoint().`);
92
+ `Override with \`probes: { port: <other> }\` on endpoint(), or set $PROBE_PORT.`);
90
93
  }
91
94
  else {
92
95
  throw err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nwire/endpoint",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Nwire — production process lifecycle. Wraps any Node server (Express, Fastify, Koa, Nest, Nwire interfaces) with K8s-grade graceful shutdown, http-terminator drain, and lightship readiness/liveness probes. Standalone — no framework dependency beyond @nwire/container.",
5
5
  "keywords": [
6
6
  "endpoint",
@@ -32,11 +32,11 @@
32
32
  "dependencies": {
33
33
  "http-terminator": "^3.2.0",
34
34
  "lightship": "^9.0.4",
35
- "@nwire/hooks": "0.13.0",
36
- "@nwire/logger": "0.13.0",
37
- "@nwire/runtime": "0.13.0",
38
- "@nwire/wires": "0.13.0",
39
- "@nwire/container": "0.13.0"
35
+ "@nwire/runtime": "0.13.1",
36
+ "@nwire/logger": "0.13.1",
37
+ "@nwire/wires": "0.13.1",
38
+ "@nwire/container": "0.13.1",
39
+ "@nwire/hooks": "0.13.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^22.19.9",