|
18 | 18 |
|
19 | 19 | ### Attention
|
20 | 20 |
|
21 |
| -There are some constraints to use Webpack bundling your code, so it is not recommended by the NestJS creator, details [here](https://github.com/nestjs/nest/issues/1706#issuecomment-579248915). Therefore, please make sure your application does not contain native bindings library, then you can enjoy the above benefits |
| 21 | +There are some constraints to using Webpack bundling your code, so it is not recommended by the NestJS creator, details [here](https://github.com/nestjs/nest/issues/1706#issuecomment-579248915). Therefore, please make sure your application does not contain native bindings library, then you can enjoy the above benefits |
22 | 22 |
|
23 | 23 | ## 📓 Commands
|
24 | 24 |
|
@@ -143,7 +143,7 @@ We overwrite the default `webpack.config.js` so that the production build can bu
|
143 | 143 |
|
144 | 144 | ### Alias Path
|
145 | 145 |
|
146 |
| -Using alias path can prevent dirty relative path (e.g. ../../../), also it is easier to import files that in the deep directory (e.g. src/assets/img/testing/...). |
| 146 | +Using an alias path can prevent dirty relative paths (e.g. ../../../), also it is easier to import files in the deep directory (e.g. src/assets/img/testing/...). |
147 | 147 |
|
148 | 148 | ```text
|
149 | 149 | # Config File
|
@@ -195,19 +195,19 @@ We use [Joi](https://joi.dev/) library for the validation, which is recommended
|
195 | 195 |
|
196 | 196 | ### HTTP Request
|
197 | 197 |
|
198 |
| -Since [@nestjs/axios](https://github.com/nestjs/axios) default return [Observable](https://rxjs.dev/guide/observable), it does not fit for the common use case (Promise based), so we use a custom module to implement secondary encapsulation of native Axios library, also extract .data from the response to prevent .data.data.data... chaining. |
| 198 | +Since [@nestjs/axios](https://github.com/nestjs/axios) default return [Observable](https://rxjs.dev/guide/observable), it does not fit the common use case (Promise based), so we use a custom module to implement secondary encapsulation of the native Axios library, also extract .data from the response to prevent .data.data.data... chaining. |
199 | 199 |
|
200 | 200 | _Reference:_
|
201 | 201 |
|
202 |
| -- [Author Recommandation](https://github.com/nestjs/nest/issues/2613#issuecomment-513141287) |
| 202 | +- [Author Recommendation](https://github.com/nestjs/nest/issues/2613#issuecomment-513141287) |
203 | 203 |
|
204 | 204 | ### Pino Logger
|
205 | 205 |
|
206 |
| -We used [nestjs-pino](https://github.com/iamolegga/nestjs-pino) to auto-log every request metadata and response time. We also centralized Pino config in `app.config.ts` for `main.ts` reuse it. |
| 206 | +We used [nestjs-pino](https://github.com/iamolegga/nestjs-pino) to auto-log every request metadata and response time. We also centralized Pino config in `app.config.ts` for `main.ts` to reuse it. |
207 | 207 |
|
208 | 208 | ### Swagger
|
209 | 209 |
|
210 |
| -[@nestjs/swagger](https://github.com/nestjs/swagger) allow you to auto-generate the API document, but here we decouple the document and the service. You can run `pnpm swagger` to generate the schema and put it into [Swagger UI](https://github.com/swagger-api/swagger-ui) to host your API document as a static page. We have two examples in `app.controller.ts` to show you how to integrate the Google JSON response format. We also have a GitHub Action example to auto-update the schema and host it to the GitHub Pages. If you do not want this setup, you can just follow [NestJS official guideline](https://docs.nestjs.com/openapi/introduction) to host your document inside the service. |
| 210 | +[@nestjs/swagger](https://github.com/nestjs/swagger) allows you to auto-generate the API document, but here we decouple the document and the service. You can run `pnpm swagger` to generate the schema and put it into [Swagger UI](https://github.com/swagger-api/swagger-ui) to host your API document as a static page. We have two examples in `app.controller.ts` to show you how to integrate the Google JSON response format. We also have a GitHub Action example to auto-update the schema and host it to the GitHub Pages. If you do not want this setup, you can just follow [NestJS official guideline](https://docs.nestjs.com/openapi/introduction) to host your document inside the service. |
211 | 211 |
|
212 | 212 | **Attention**:
|
213 | 213 | You do not need to wrap the data object to your DTO for every response, you only have to name your DTO end with 'Res', `swagger.ts` script will auto-wrap for you and display correctly in the Swagger UI.
|
|
0 commit comments