diff --git a/docs/fundamentals/lazy-loading-modules.md b/docs/fundamentals/lazy-loading-modules.md index ba2e3af..018d3f9 100644 --- a/docs/fundamentals/lazy-loading-modules.md +++ b/docs/fundamentals/lazy-loading-modules.md @@ -47,7 +47,6 @@ const moduleRef = await this.lazyModuleLoader.load(() => LazyModule); > ``` > > 此外,"懒加载"模块与应用启动时急切加载的模块以及后续在应用中注册的其他懒加载模块共享相同的模块关系图。 -``` 其中 `lazy.module.ts` 是一个导出**常规 Nest 模块**的 TypeScript 文件(无需额外修改)。 @@ -76,7 +75,7 @@ const lazyService = moduleRef.get(LazyService); ``` > warning **警告** 如果使用 **Webpack**,请确保更新您的 `tsconfig.json` 文件 - 将 `compilerOptions.module` 设置为 `"esnext"` 并添加值为 `"node"` 的 `compilerOptions.moduleResolution` 属性: -> +> > ```json > { > "compilerOptions": { @@ -86,7 +85,7 @@ const lazyService = moduleRef.get(LazyService); > } > } > ``` -> +> > 设置这些选项后,您就能利用[代码分割](https://webpack.js.org/guides/code-splitting/)功能。 #### 懒加载控制器、网关和解析器 diff --git a/docs/recipes/terminus.md b/docs/recipes/terminus.md index cb784f7..c115834 100644 --- a/docs/recipes/terminus.md +++ b/docs/recipes/terminus.md @@ -80,6 +80,8 @@ export class HealthController { ]); } } +``` + ```typescript title="health.module" import { Module } from '@nestjs/common'; import { TerminusModule } from '@nestjs/terminus'; @@ -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 | @@ -129,7 +131,6 @@ export class HealthModule {} ```typescript title="health.controller" // Within the `HealthController`-class -``` @Get() @HealthCheck() @@ -239,7 +240,6 @@ export class HealthController { ```typescript title="health.controller" // Within the `HealthController`-class -``` @Get() @HealthCheck() @@ -283,7 +283,6 @@ export class HealthController { ```typescript title="health.controller" // Within the `HealthController`-class -``` @Get() @HealthCheck()