@venizia/ignis-docs 0.2.0 → 0.2.1-0

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 (142) hide show
  1. package/README.md +14 -14
  2. package/content/best-practices/api-usage-examples.md +39 -19
  3. package/content/best-practices/architectural-patterns.md +22 -11
  4. package/content/best-practices/architecture-decisions.md +29 -16
  5. package/content/best-practices/code-style-standards/advanced-patterns.md +43 -31
  6. package/content/best-practices/code-style-standards/constants-configuration.md +19 -4
  7. package/content/best-practices/code-style-standards/control-flow.md +33 -1
  8. package/content/best-practices/code-style-standards/documentation.md +28 -8
  9. package/content/best-practices/code-style-standards/function-patterns.md +15 -4
  10. package/content/best-practices/code-style-standards/index.md +7 -2
  11. package/content/best-practices/code-style-standards/naming-conventions.md +26 -2
  12. package/content/best-practices/code-style-standards/route-definitions.md +9 -5
  13. package/content/best-practices/code-style-standards/tooling.md +14 -1
  14. package/content/best-practices/code-style-standards/type-safety.md +39 -6
  15. package/content/best-practices/common-pitfalls.md +59 -35
  16. package/content/best-practices/contribution-workflow.md +6 -2
  17. package/content/best-practices/data-modeling.md +78 -62
  18. package/content/best-practices/deployment-strategies.md +56 -19
  19. package/content/best-practices/error-handling.md +182 -93
  20. package/content/best-practices/index.md +6 -0
  21. package/content/best-practices/performance-optimization.md +26 -13
  22. package/content/best-practices/security-guidelines.md +35 -9
  23. package/content/best-practices/testing-strategies.md +7 -2
  24. package/content/best-practices/troubleshooting-tips.md +27 -17
  25. package/content/extensions/components/api-reference.md +107 -322
  26. package/content/extensions/components/authentication/api.md +454 -603
  27. package/content/extensions/components/authentication/errors.md +121 -498
  28. package/content/extensions/components/authentication/index.md +88 -801
  29. package/content/extensions/components/authentication/usage.md +207 -956
  30. package/content/extensions/components/authorization/api.md +736 -656
  31. package/content/extensions/components/authorization/errors.md +168 -206
  32. package/content/extensions/components/authorization/index.md +82 -797
  33. package/content/extensions/components/authorization/usage.md +194 -527
  34. package/content/extensions/components/health-check.md +71 -243
  35. package/content/extensions/components/mail/api.md +504 -287
  36. package/content/extensions/components/mail/errors.md +73 -61
  37. package/content/extensions/components/mail/index.md +96 -467
  38. package/content/extensions/components/mail/usage.md +130 -172
  39. package/content/extensions/components/request-tracker.md +66 -173
  40. package/content/extensions/components/socket-io/api.md +195 -13
  41. package/content/extensions/components/socket-io/errors.md +3 -3
  42. package/content/extensions/components/socket-io/index.md +50 -337
  43. package/content/extensions/components/socket-io/usage.md +143 -26
  44. package/content/extensions/components/static-asset/api.md +410 -142
  45. package/content/extensions/components/static-asset/errors.md +110 -53
  46. package/content/extensions/components/static-asset/index.md +79 -608
  47. package/content/extensions/components/static-asset/usage.md +180 -300
  48. package/content/extensions/components/websocket/api.md +275 -399
  49. package/content/extensions/components/websocket/errors.md +47 -56
  50. package/content/extensions/components/websocket/index.md +74 -407
  51. package/content/extensions/components/websocket/usage.md +110 -341
  52. package/content/extensions/helpers/cron/index.md +51 -160
  53. package/content/extensions/helpers/crypto/index.md +62 -483
  54. package/content/extensions/helpers/crypto/reference.md +456 -0
  55. package/content/extensions/helpers/env/index.md +60 -178
  56. package/content/extensions/helpers/error/index.md +221 -207
  57. package/content/extensions/helpers/inversion/index.md +65 -556
  58. package/content/extensions/helpers/inversion/reference.md +522 -0
  59. package/content/extensions/helpers/kafka/admin.md +20 -1
  60. package/content/extensions/helpers/kafka/compile-binary.md +41 -35
  61. package/content/extensions/helpers/kafka/consumer.md +54 -20
  62. package/content/extensions/helpers/kafka/examples.md +21 -16
  63. package/content/extensions/helpers/kafka/index.md +80 -610
  64. package/content/extensions/helpers/kafka/producer.md +134 -5
  65. package/content/extensions/helpers/kafka/schema-registry.md +45 -70
  66. package/content/extensions/helpers/logger/hf-logger.md +193 -0
  67. package/content/extensions/helpers/logger/index.md +64 -563
  68. package/content/extensions/helpers/logger/pino.md +85 -0
  69. package/content/extensions/helpers/logger/reference.md +746 -0
  70. package/content/extensions/helpers/network/api.md +241 -195
  71. package/content/extensions/helpers/network/index.md +72 -530
  72. package/content/extensions/helpers/queue/index.md +72 -900
  73. package/content/extensions/helpers/queue/reference.md +467 -0
  74. package/content/extensions/helpers/redis/index.md +73 -645
  75. package/content/extensions/helpers/redis/reference.md +727 -0
  76. package/content/extensions/helpers/secrets/index.md +66 -0
  77. package/content/extensions/helpers/socket-io/api.md +305 -203
  78. package/content/extensions/helpers/socket-io/index.md +66 -432
  79. package/content/extensions/helpers/storage/api.md +564 -462
  80. package/content/extensions/helpers/storage/index.md +77 -573
  81. package/content/extensions/helpers/types/index.md +66 -499
  82. package/content/extensions/helpers/types/reference.md +650 -0
  83. package/content/extensions/helpers/uid/index.md +58 -227
  84. package/content/extensions/helpers/websocket/api.md +329 -216
  85. package/content/extensions/helpers/websocket/index.md +65 -503
  86. package/content/extensions/helpers/worker-thread/index.md +58 -396
  87. package/content/extensions/helpers/worker-thread/reference.md +428 -0
  88. package/content/guides/core-concepts/persistent/models.md +1 -1
  89. package/content/guides/core-concepts/persistent/search-typesense.md +3 -3
  90. package/content/guides/core-concepts/persistent/transactions.md +1 -1
  91. package/content/guides/core-concepts/secrets-vault.md +177 -0
  92. package/content/guides/core-concepts/services.md +1 -1
  93. package/content/guides/migrations/redis-helpers-migration.md +1 -1
  94. package/content/guides/migrations/unified-connectors-migration.md +2 -2
  95. package/content/guides/tutorials/ecommerce-api.md +3 -8
  96. package/content/references/base/application.md +1 -1
  97. package/content/references/base/connectors.md +79 -136
  98. package/content/references/base/datasources-reference.md +599 -0
  99. package/content/references/base/datasources.md +84 -444
  100. package/content/references/base/dependency-injection.md +17 -39
  101. package/content/references/base/filter-system/application-usage.md +69 -121
  102. package/content/references/base/filter-system/array-operators.md +12 -0
  103. package/content/references/base/filter-system/comparison-operators.md +12 -0
  104. package/content/references/base/filter-system/default-filter.md +136 -348
  105. package/content/references/base/filter-system/fields-order-pagination.md +38 -16
  106. package/content/references/base/filter-system/index.md +106 -257
  107. package/content/references/base/filter-system/json-filtering.md +12 -2
  108. package/content/references/base/filter-system/list-operators.md +16 -2
  109. package/content/references/base/filter-system/logical-operators.md +13 -0
  110. package/content/references/base/filter-system/null-operators.md +13 -0
  111. package/content/references/base/filter-system/pattern-matching.md +12 -0
  112. package/content/references/base/filter-system/quick-reference.md +11 -2
  113. package/content/references/base/filter-system/range-operators.md +12 -0
  114. package/content/references/base/filter-system/tips.md +70 -133
  115. package/content/references/base/filter-system/use-cases.md +156 -233
  116. package/content/references/base/middlewares.md +35 -21
  117. package/content/references/base/models-reference.md +886 -0
  118. package/content/references/base/models.md +80 -1452
  119. package/content/references/base/repositories/advanced.md +156 -192
  120. package/content/references/base/repositories/index.md +77 -650
  121. package/content/references/base/repositories/mixins.md +22 -18
  122. package/content/references/base/repositories/relations.md +123 -171
  123. package/content/references/base/repositories/soft-deletable.md +58 -56
  124. package/content/references/base/secrets.md +263 -0
  125. package/content/references/base/services.md +2 -2
  126. package/content/references/configuration/environment-variables.md +48 -4
  127. package/content/references/configuration/index.md +49 -31
  128. package/content/references/quick-reference.md +3 -16
  129. package/content/references/utilities/crypto.md +35 -76
  130. package/content/references/utilities/date.md +33 -73
  131. package/content/references/utilities/index.md +1 -1
  132. package/content/references/utilities/jsx-reference.md +298 -0
  133. package/content/references/utilities/jsx.md +82 -525
  134. package/content/references/utilities/module.md +29 -62
  135. package/content/references/utilities/parse.md +34 -64
  136. package/content/references/utilities/performance.md +33 -58
  137. package/content/references/utilities/promise.md +28 -62
  138. package/content/references/utilities/request.md +57 -218
  139. package/content/references/utilities/schema.md +43 -137
  140. package/content/references/utilities/statuses-reference.md +361 -0
  141. package/content/references/utilities/statuses.md +63 -667
  142. package/package.json +8 -8
@@ -1,6 +1,6 @@
1
1
  # Health Check
2
2
 
3
- Simple endpoint for monitoring application health -- essential for microservices and containerized deployments.
3
+ A minimal status endpoint for uptime monitoring - the default target for load balancer health checks and Kubernetes liveness probes.
4
4
 
5
5
  ## Quick Reference
6
6
 
@@ -17,200 +17,106 @@ import { HealthCheckComponent, HealthCheckBindingKeys } from '@venizia/ignis';
17
17
  import type { IHealthCheckOptions } from '@venizia/ignis';
18
18
  ```
19
19
 
20
- ## Setup
20
+ ## In one example
21
21
 
22
- ### Step 1: Bind Configuration (Optional)
23
-
24
- Skip this step to use the default `/health` path. To customize the path:
22
+ Register the component with no configuration - `GET /health` and `POST /health/ping` are live immediately.
25
23
 
26
24
  ```typescript
27
- import { HealthCheckBindingKeys, IHealthCheckOptions } from '@venizia/ignis';
25
+ import { HealthCheckComponent, BaseApplication, ValueOrPromise } from '@venizia/ignis';
28
26
 
29
- // In your Application class's preConfigure method
30
- this.bind<IHealthCheckOptions>({
31
- key: HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS,
32
- }).toValue({
33
- restOptions: { path: '/health-check' },
34
- });
27
+ export class Application extends BaseApplication {
28
+ preConfigure(): ValueOrPromise<void> {
29
+ this.component(HealthCheckComponent);
30
+ }
31
+ }
35
32
  ```
36
33
 
37
- ### Step 2: Register Component
38
-
39
- ```typescript
40
- import { HealthCheckComponent } from '@venizia/ignis';
41
-
42
- preConfigure(): ValueOrPromise<void> {
43
- // ... optional bindings from Step 1
44
- this.component(HealthCheckComponent);
45
- }
34
+ ```bash
35
+ curl localhost:3000/health
36
+ # { "status": "ok" }
46
37
  ```
47
38
 
48
- ### Step 3: Use
39
+ ## How it works
49
40
 
50
- The health check endpoints are auto-registered -- no injection needed. Once the component is registered, `GET /health` and `POST /health/ping` are available immediately.
41
+ - **Auto-registered controller.** `HealthCheckComponent.binding()` applies `@controller({ path })` to `HealthCheckController` via `Reflect.decorate` at runtime, then calls `this.application.controller(HealthCheckController)` - the path comes from DI, not a hardcoded class decorator.
42
+ - **Options are optional, field by field.** `IHealthCheckOptions.restOptions.path` is optional; a partially-filled binding (e.g., `{ restOptions: {} }`) still resolves - the component reads `healthOptions?.restOptions?.path ?? '/health'`, falling back per field rather than discarding the whole binding.
43
+ - **The default binding wins the race if you're late.** The constructor registers `HEALTH_CHECK_OPTIONS` via `initDefault: { enable: true }`, which runs before `binding()`. `initDefaultBindings()` only sets a key when `container.isBound()` is false - so a custom binding must exist BEFORE `this.component(HealthCheckComponent)` runs, or the default has already claimed the slot.
44
+ - **Three route styles, one controller.** `HealthCheckController` demonstrates all three IGNIS route patterns: fluent (`bindRoute().to()`) for `GET /`, decorator (`@api()`) for `POST /ping`, and imperative (`defineRoute()`, commented out in source) - a handy reference when picking a style for your own controllers.
51
45
 
52
- > [!TIP]
53
- > If you customized the path in Step 1, the endpoints will be at your custom path instead (e.g., `GET /health-check` and `POST /health-check/ping`).
46
+ ## Common tasks
54
47
 
55
- ## Configuration
48
+ ### Customize the health check path
49
+ Bind `IHealthCheckOptions` BEFORE registering the component - order matters (see above).
56
50
 
57
- | Option | Type | Default | Description |
58
- |--------|------|---------|-------------|
59
- | `restOptions.path` | `string` | `'/health'` | Base path for health endpoints |
51
+ ```typescript
52
+ import { HealthCheckBindingKeys, IHealthCheckOptions } from '@venizia/ignis';
60
53
 
61
- The component uses `IHealthCheckOptions` bound to `HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS`. If no custom binding is found, it falls back to:
54
+ this.bind<IHealthCheckOptions>({
55
+ key: HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS,
56
+ }).toValue({ restOptions: { path: '/health-check' } });
62
57
 
63
- ```typescript
64
- const DEFAULT_OPTIONS: IHealthCheckOptions = {
65
- restOptions: { path: '/health' },
66
- };
58
+ this.component(HealthCheckComponent); // AFTER the bind
67
59
  ```
68
60
 
69
- #### IHealthCheckOptions -- Full Reference
70
- ```typescript
71
- interface IHealthCheckOptions {
72
- restOptions: { path: string };
73
- }
74
- ```
61
+ ### Call the ping endpoint
62
+ `POST /health/ping` echoes `message` back with a server timestamp - useful for round-trip latency checks and body-parsing smoke tests.
75
63
 
76
- The `path` value is applied via `@controller({ path })` decorator on `HealthCheckController` during the component's `binding()` phase. All controller routes are relative to this base path.
64
+ ```bash
65
+ curl -X POST localhost:3000/health/ping \
66
+ -H 'content-type: application/json' \
67
+ -d '{"message":"hello"}'
68
+ # { "type": "PONG", "date": "2026-02-11T12:00:00.000Z", "message": "hello" }
69
+ ```
77
70
 
78
- ### Component Lifecycle
71
+ | Field | Type | Required | Constraints |
72
+ |-------|------|----------|-------------|
73
+ | `type` | `string` | No | Defaults to `"PING"` |
74
+ | `message` | `string` | Yes | Min 1, max 255 characters |
79
75
 
80
- 1. **`constructor()`** -- Receives `BaseApplication` via `@inject({ key: CoreBindings.APPLICATION_INSTANCE })`. Calls `super()` with `initDefault: { enable: true, container: application }` and provides default bindings for `HEALTH_CHECK_OPTIONS`:
76
+ ### Fix "health check endpoint returns 404"
77
+ Register the component in `preConfigure()`, before any controller registration completes.
81
78
 
82
79
  ```typescript
83
- constructor(
84
- @inject({ key: CoreBindings.APPLICATION_INSTANCE }) private application: BaseApplication,
85
- ) {
86
- super({
87
- scope: HealthCheckComponent.name,
88
- initDefault: { enable: true, container: application },
89
- bindings: {
90
- [HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS]: Binding.bind<IHealthCheckOptions>({
91
- key: HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS,
92
- }).toValue(DEFAULT_OPTIONS),
93
- },
94
- });
80
+ preConfigure(): ValueOrPromise<void> {
81
+ this.component(HealthCheckComponent);
82
+ // ... other registrations
95
83
  }
96
84
  ```
97
85
 
98
- The `initDefault: { enable: true, container: application }` option tells `BaseComponent` to automatically register all entries in `this.bindings` into the DI container before `binding()` is called. This happens inside `BaseComponent.configure()` via `initDefaultBindings()`, which iterates over `this.bindings` and calls `container.set()` for any key not already bound. This means users who bind their own `HEALTH_CHECK_OPTIONS` before registering the component will keep their custom value -- the default is only applied if the key is unbound.
86
+ ## Reference
99
87
 
100
- 2. **`binding()`** -- Reads options from the DI container using `application.get()` with `isOptional: true` and falls back to `DEFAULT_OPTIONS` via the `??` operator. Applies `@controller({ path })` decorator dynamically to `HealthCheckController` using `Reflect.decorate`. Registers the controller with the application:
88
+ ### Configuration
89
+ | Option | Type | Default | Description |
90
+ |--------|------|---------|-------------|
91
+ | `restOptions.path` | `string` (optional) | `'/health'` | Base path for health endpoints |
101
92
 
102
93
  ```typescript
103
- override binding(): ValueOrPromise<void> {
104
- const healthOptions =
105
- this.application.get<IHealthCheckOptions>({
106
- key: HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS,
107
- isOptional: true,
108
- }) ?? DEFAULT_OPTIONS;
109
-
110
- Reflect.decorate(
111
- [controller({ path: healthOptions.restOptions.path })],
112
- HealthCheckController,
113
- );
114
- this.application.controller(HealthCheckController);
94
+ interface IHealthCheckOptions {
95
+ /** Partially-filled bindings are accepted; every missing field falls back to its default. */
96
+ restOptions?: { path?: string };
115
97
  }
116
98
  ```
117
99
 
118
- > [!NOTE]
119
- > The `@controller` decorator is applied dynamically during `binding()`, not statically on the class definition. This allows the path to be configured at runtime via DI bindings.
120
-
121
- ## Binding Keys
122
-
100
+ ### Binding keys
123
101
  | Key | Constant | Type | Required | Default |
124
102
  |-----|----------|------|----------|---------|
125
103
  | `@app/health-check/options` | `HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS` | `IHealthCheckOptions` | No | `{ restOptions: { path: '/health' } }` |
126
104
 
127
- > [!NOTE]
128
- > The component provides a default binding for `HEALTH_CHECK_OPTIONS` via `initDefault`. You only need to bind this key if you want to customize the endpoint path. If you do bind it, do so **before** calling `this.component(HealthCheckComponent)` -- the `initDefaultBindings()` check uses `isBound()` and will skip keys that already exist in the container.
129
-
130
- ### Rest Paths
131
-
132
- | Constant | Value | Full Path (default) |
105
+ ### REST paths
106
+ | Constant | Value | Full path (default) |
133
107
  |----------|-------|---------------------|
134
108
  | `HealthCheckRestPaths.ROOT` | `/` | `GET /health` |
135
109
  | `HealthCheckRestPaths.PING` | `/ping` | `POST /health/ping` |
136
110
 
137
- ### Rest Path Constants
138
-
139
- ```typescript
140
- class HealthCheckRestPaths {
141
- static readonly ROOT = '/'; // GET /health (or custom base path)
142
- static readonly PING = '/ping'; // POST /health/ping (or custom base path + /ping)
143
- }
144
- ```
145
-
146
- The controller defines two internal route paths via `HealthCheckRestPaths`. These paths are relative to the base path configured in `IHealthCheckOptions.restOptions.path`.
147
-
148
- ## API Endpoints
111
+ Paths are relative to the base path configured in `IHealthCheckOptions.restOptions.path`.
149
112
 
113
+ ### API endpoints
150
114
  | Method | Path | Description | Response |
151
115
  |--------|------|-------------|----------|
152
116
  | `GET` | `/health` | Basic health check | `{ "status": "ok" }` |
153
117
  | `POST` | `/health/ping` | Echo test | `{ "type": "PONG", "date": "...", "message": "..." }` |
154
118
 
155
- ### GET /health
156
-
157
- Returns a simple health status object. Used by load balancers, Kubernetes liveness probes, and monitoring tools to verify the application is running.
158
-
159
- ### POST /health/ping
160
-
161
- Echoes a message back with a server timestamp. Useful for:
162
- - Verifying end-to-end connectivity
163
- - Measuring round-trip latency
164
- - Testing request body parsing
165
-
166
- #### Request & Response Specifications
167
-
168
- **GET /health**
169
-
170
- Response `200`:
171
- ```json
172
- {
173
- "status": "ok"
174
- }
175
- ```
176
-
177
- **POST /health/ping**
178
-
179
- Request body:
180
- ```json
181
- {
182
- "type": "PING",
183
- "message": "Any string here"
184
- }
185
- ```
186
-
187
- | Field | Type | Required | Constraints |
188
- |-------|------|----------|-------------|
189
- | `type` | `string` | No | Defaults to `"PING"` |
190
- | `message` | `string` | Yes | Min 1, max 255 characters |
191
-
192
- Response `200`:
193
- ```json
194
- {
195
- "type": "PONG",
196
- "date": "2026-02-11T12:00:00.000Z",
197
- "message": "Any string here"
198
- }
199
- ```
200
-
201
- ### Route Definition Patterns
202
-
203
- The `HealthCheckController` demonstrates all three route definition patterns supported by IGNIS:
204
-
205
- | Pattern | Method | Used For |
206
- |---------|--------|----------|
207
- | **Fluent API** (`bindRoute().to()`) | Root health check (`GET /`) | Inline handlers, method chaining |
208
- | **Imperative API** (`defineRoute()`) | (commented out in source) | Direct handler assignment in `binding()` |
209
- | **Decorator API** (`@api()`) | Ping endpoint (`POST /ping`) | Class method handlers with OpenAPI metadata |
210
-
211
- The controller uses `this.definitions = RouteConfigs` to store route configurations for introspection. This is optional but enables tools to discover available routes without invoking `binding()`.
212
-
213
- #### Controller Source
119
+ ### Controller source
214
120
  ```typescript
215
121
  import {
216
122
  BaseRestController, IControllerOptions, TRouteContext,
@@ -286,101 +192,15 @@ export class HealthCheckController extends BaseRestController {
286
192
  }
287
193
  ```
288
194
 
289
- #### Route Configuration Schemas
290
-
291
- **Root endpoint (`GET /`):**
292
- ```typescript
293
- const RouteConfigs = {
294
- ROOT: {
295
- method: HTTP.Methods.GET,
296
- path: HealthCheckRestPaths.ROOT,
297
- responses: jsonResponse({
298
- schema: z.object({ status: z.string() }).openapi({
299
- description: 'HealthCheck Schema',
300
- examples: [{ status: 'ok' }],
301
- }),
302
- description: 'Health check status',
303
- }),
304
- },
305
- ```
306
-
307
- **Ping endpoint (`POST /ping`):**
308
- ```typescript
309
- PING: {
310
- method: HTTP.Methods.POST,
311
- path: HealthCheckRestPaths.PING,
312
- request: {
313
- body: jsonContent({
314
- description: 'PING | Request body',
315
- schema: z.object({
316
- type: z.string().optional().default('PING'),
317
- message: z.string().min(1).max(255),
318
- }),
319
- }),
320
- },
321
- responses: jsonResponse({
322
- schema: z.object({
323
- type: z.string().optional().default('PONG'),
324
- date: z.iso.datetime(),
325
- message: z.string(),
326
- }).openapi({
327
- description: 'HealthCheck PingPong Schema',
328
- examples: [{ date: new Date().toISOString(), message: 'ok' }],
329
- }),
330
- description: 'HealthCheck PingPong Message',
331
- }),
332
- },
333
- } as const;
334
- ```
335
-
336
195
  ## Troubleshooting
337
196
 
338
- ### "Health check endpoint returns 404"
339
-
340
- **Cause:** The `HealthCheckComponent` was not registered in your application, or it was registered after controllers were already mounted.
341
-
342
- **Fix:** Register the component in `preConfigure()` before any controller registration:
343
-
344
- ```typescript
345
- preConfigure(): ValueOrPromise<void> {
346
- this.component(HealthCheckComponent);
347
- // ... other registrations
348
- }
349
- ```
350
-
351
- ### "Custom path is not applied"
197
+ | Symptom | Cause | Fix |
198
+ |---------|-------|-----|
199
+ | `GET /health` returns 404 | `HealthCheckComponent` not registered, or registered after controllers were already mounted | Call `this.component(HealthCheckComponent)` in `preConfigure()` |
200
+ | Custom path not applied | Custom `IHealthCheckOptions` bound AFTER `this.component()` ran - the default binding already claimed the DI key | Bind options BEFORE calling `this.component(HealthCheckComponent)` |
201
+ | `POST /health/ping` returns a validation error | `message` is missing, or exceeds 255 characters | Send a `message` string between 1 and 255 characters |
352
202
 
353
- **Cause:** The custom `IHealthCheckOptions` binding was registered after the component. The component reads options during its `binding()` phase -- if no binding exists at that point, it uses the default `/health` path. However, because `HealthCheckComponent` uses `initDefault: { enable: true }`, it also registers a default binding before `binding()` runs. If you bind your custom options after calling `this.component()`, the default has already been set and your override will not take effect during the current lifecycle.
354
-
355
- **Fix:** Bind your custom options before calling `this.component(HealthCheckComponent)`:
356
-
357
- ```typescript
358
- preConfigure(): ValueOrPromise<void> {
359
- // Bind options FIRST
360
- this.bind<IHealthCheckOptions>({
361
- key: HealthCheckBindingKeys.HEALTH_CHECK_OPTIONS,
362
- }).toValue({
363
- restOptions: { path: '/custom-health' },
364
- });
365
-
366
- // THEN register component
367
- this.component(HealthCheckComponent);
368
- }
369
- ```
370
-
371
- ### "POST /health/ping returns validation error"
372
-
373
- **Cause:** The request body is missing the required `message` field, or the `message` value exceeds the 255-character limit.
374
-
375
- **Fix:** Ensure the request body includes a `message` string between 1 and 255 characters:
376
-
377
- ```json
378
- {
379
- "message": "hello"
380
- }
381
- ```
382
-
383
- ## See Also
203
+ ## See also
384
204
 
385
205
  - **Guides:**
386
206
  - [Components Overview](/guides/core-concepts/components) - Component system basics
@@ -391,3 +211,11 @@ preConfigure(): ValueOrPromise<void> {
391
211
 
392
212
  - **Best Practices:**
393
213
  - [Deployment Strategies](/best-practices/deployment-strategies) - Production monitoring
214
+
215
+ **Files:**
216
+
217
+ - [`packages/core/src/components/health-check/component.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core/src/components/health-check/component.ts) - `HealthCheckComponent`
218
+ - [`packages/core/src/components/health-check/controller.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core/src/components/health-check/controller.ts) - `HealthCheckController`
219
+ - [`packages/core/src/components/health-check/common/types.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core/src/components/health-check/common/types.ts) - `IHealthCheckOptions`
220
+ - [`packages/core/src/components/health-check/common/keys.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core/src/components/health-check/common/keys.ts) - `HealthCheckBindingKeys`
221
+ - [`packages/core/src/components/health-check/common/rest-paths.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/core/src/components/health-check/common/rest-paths.ts) - `HealthCheckRestPaths`