@terreno/api-health 56.0.0-beta.0 → 57.0.0-beta.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -2
  3. package/package.json +3 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Flourish Health, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @terreno/api-health
2
2
 
3
- Health check plugin for `@terreno/api`. Adds a `/health` endpoint to your Express server with configurable checks.
3
+ Health check TerrenoPlugin for `@terreno/api` — adds a configurable `GET /health` endpoint with optional custom checks.
4
4
 
5
- See the package source for usage and configuration details.
5
+ ## Install
6
+
7
+ ```bash
8
+ bun add @terreno/api-health @terreno/api
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```typescript
14
+ import {TerrenoApp} from "@terreno/api";
15
+ import {HealthApp} from "@terreno/api-health";
16
+ import mongoose from "mongoose";
17
+ import {User} from "./models/user";
18
+
19
+ const healthApp = new HealthApp({
20
+ path: "/health",
21
+ check: async () => {
22
+ try {
23
+ await mongoose.connection.db!.admin().ping();
24
+ return {healthy: true, details: {database: "connected"}};
25
+ } catch {
26
+ return {healthy: false, details: {database: "disconnected"}};
27
+ }
28
+ },
29
+ });
30
+
31
+ new TerrenoApp({userModel: User}).register(healthApp).start();
32
+ ```
33
+
34
+ Returns `200` with `{healthy: true, ...}` when healthy, `503` when `healthy: false`.
35
+
36
+ ## What's included
37
+
38
+ - `HealthApp` — `TerrenoPlugin` registering a health endpoint
39
+ - `HealthOptions` — `enabled`, `path`, and optional async `check` function
40
+ - `HealthCheckResult` — `{healthy: boolean, details?: Record<string, unknown>}`
41
+ - Default behavior: `GET /health` returns `{healthy: true}` when no custom check is provided
42
+ - Supports load balancer probes, Kubernetes liveness/readiness, and database connectivity checks
43
+
44
+ ## Documentation
45
+
46
+ Full API reference: [docs/reference/api-health.md](https://github.com/flourishhealth/terreno/blob/master/docs/reference/api-health.md)
47
+
48
+ ## License and Contributing
49
+
50
+ Licensed under the [MIT License](https://github.com/flourishhealth/terreno/blob/master/LICENSE). See [CONTRIBUTING.md](https://github.com/flourishhealth/terreno/blob/master/CONTRIBUTING.md) for contribution guidelines.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/FlourishHealth/terreno/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@terreno/api": "56.0.0-beta.0",
7
+ "@terreno/api": "57.0.0-beta.1",
8
8
  "express": "^5.2.1"
9
9
  },
10
10
  "description": "Health check plugin for @terreno/api",
@@ -23,7 +23,7 @@
23
23
  "express",
24
24
  "terreno"
25
25
  ],
26
- "license": "Apache-2.0",
26
+ "license": "MIT",
27
27
  "main": "dist/index.js",
28
28
  "name": "@terreno/api-health",
29
29
  "publishConfig": {
@@ -44,5 +44,5 @@
44
44
  "test:coverage": "bun run ../scripts/check-coverage.ts"
45
45
  },
46
46
  "types": "dist/index.d.ts",
47
- "version": "56.0.0-beta.0"
47
+ "version": "57.0.0-beta.1"
48
48
  }