@rfprodz/backend-diagnostics 1.0.0 → 1.0.2

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 (2) hide show
  1. package/README.md +48 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # backend-diagnostics
2
2
 
3
- Diagnostics functionality for backends.
3
+ Diagnostics module for NestJS backends.
4
4
 
5
5
  ## Developer commands reference
6
6
 
@@ -8,6 +8,53 @@ Diagnostics functionality for backends.
8
8
  npx nx run tools:help --search backend-diagnostics:
9
9
  ```
10
10
 
11
+ ## Usage
12
+
13
+ Add to the root API module
14
+
15
+ ```typescript
16
+ ...
17
+ @Module({
18
+ ...
19
+ imports: [
20
+ ...
21
+ HttpModule.registerAsync({
22
+ useFactory: () => ({
23
+ timeout: 10000,
24
+ maxRedirects: 5,
25
+ }),
26
+ }),
27
+ AppDiagnosticsModule.forRoot(),
28
+ ...
29
+ ],
30
+ ...
31
+ })
32
+ export class AppApiModule {}
33
+ ```
34
+
35
+ Add to the `main.ts` file
36
+
37
+ ```typescript
38
+ /**
39
+ * Express server.
40
+ */
41
+ const server: e.Express = e();
42
+
43
+ ...
44
+
45
+ async function bootstrap(expressInstance: e.Express): Promise<INestApplication> {
46
+ const app = await NestFactory.create(AppApiModule, new ExpressAdapter(expressInstance));
47
+ app.useWebSocketAdapter(new WsAdapter(app));
48
+
49
+ ...
50
+
51
+ return app.init();
52
+ }
53
+
54
+ void bootstrap(server);
55
+
56
+ ```
57
+
11
58
  ## References
12
59
 
13
60
  - [Nx](https://nx.dev)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rfprodz/backend-diagnostics",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "NestJS API diagnostics module.",
5
5
  "keywords": [
6
6
  "nestjs-controller",
@@ -19,8 +19,8 @@
19
19
  "license": "MIT",
20
20
  "author": "rfprod <zoidenmacht@zoho.com>",
21
21
  "dependencies": {
22
- "@grpc/grpc-js": "1.8.11",
23
- "@jest/types": "29.4.3",
22
+ "@grpc/grpc-js": "1.8.12",
23
+ "@jest/types": "29.5.0",
24
24
  "@nestjs/core": "9.3.9",
25
25
  "@nestjs/microservices": "9.3.9",
26
26
  "@nestjs/platform-express": "9.3.9",