Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/fundamentals/lazy-loading-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const moduleRef = await this.lazyModuleLoader.load(() => LazyModule);
> ```
>
> 此外,"懒加载"模块与应用启动时急切加载的模块以及后续在应用中注册的其他懒加载模块共享相同的模块关系图。
```

其中 `lazy.module.ts` 是一个导出**常规 Nest 模块**的 TypeScript 文件(无需额外修改)。

Expand Down Expand Up @@ -76,7 +75,7 @@ const lazyService = moduleRef.get(LazyService);
```

> warning **警告** 如果使用 **Webpack**,请确保更新您的 `tsconfig.json` 文件 - 将 `compilerOptions.module` 设置为 `"esnext"` 并添加值为 `"node"` 的 `compilerOptions.moduleResolution` 属性:
>
>
> ```json
> {
> "compilerOptions": {
Expand All @@ -86,7 +85,7 @@ const lazyService = moduleRef.get(LazyService);
> }
> }
> ```
>
>
> 设置这些选项后,您就能利用[代码分割](https://webpack.js.org/guides/code-splitting/)功能。

#### 懒加载控制器、网关和解析器
Expand Down
11 changes: 5 additions & 6 deletions docs/recipes/terminus.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export class HealthController {
]);
}
}
```

```typescript title="health.module"
import { Module } from '@nestjs/common';
import { TerminusModule } from '@nestjs/terminus';
Expand Down Expand Up @@ -114,9 +116,9 @@ export class HealthModule {}

该响应对象的接口可通过 `@nestjs/terminus` 包中的 `HealthCheckResult` 接口访问。

| | | |
| ------- | ---------------------------------------------------------------------------------------------------------------------------- | ------- | ---- | --------------- |
| status | 若任何健康指标检查失败,状态将显示为 'error'。当 NestJS 应用正在关闭但仍接受 HTTP 请求时,健康检查状态将为 'shutting_down'。 | 'error' | 'ok' | 'shutting_down' |
| | | |
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| status | 若任何健康指标检查失败,状态将显示为 'error'。当 NestJS 应用正在关闭但仍接受 HTTP 请求时,健康检查状态将为 'shutting_down'。 | `'error' \| 'ok' \| 'shutting_down'` |
| info | 包含所有状态为 'up'(即"健康")的健康指标信息的对象。 | object |
| error | 包含所有状态为 'down'(即"不健康")的健康指标信息的对象。 | object |
| details | 包含每个健康指标所有信息的对象 | object |
Expand All @@ -129,7 +131,6 @@ export class HealthModule {}

```typescript title="health.controller"
// Within the `HealthController`-class
```

@Get()
@HealthCheck()
Expand Down Expand Up @@ -239,7 +240,6 @@ export class HealthController {

```typescript title="health.controller"
// Within the `HealthController`-class
```

@Get()
@HealthCheck()
Expand Down Expand Up @@ -283,7 +283,6 @@ export class HealthController {

```typescript title="health.controller"
// Within the `HealthController`-class
```

@Get()
@HealthCheck()
Expand Down