Skip to content

Commit c24ca91

Browse files
author
alex
committed
docs(microservices): update structure
1 parent 2343f01 commit c24ca91

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

content/faq/hybrid-application.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ await app.startAllMicroservicesAsync();
3535
await app.listen(3001);
3636
```
3737

38-
#### Sharing configuration
39-
40-
By default a hybrid application will not inherit global pipes, interceptors, guards and filters configured for the main (HTTP-based) application.
41-
To inherit these configuration properties from the main application, set the `inheritAppConfig` property in the second argument (an optional options object) of the `connectMicroservice()` call, as follow:
42-
43-
```typescript
44-
const microservice = app.connectMicroservice({
45-
transport: Transport.TCP
46-
}, { inheritAppConfig: true });
47-
```
48-
4938
For bind `@MessagePattern()` only to one transport of microservices in hybrid application with multiple microservices can use second argument which should get value from `Transport` enum
5039

5140
```typescript
@@ -74,3 +63,14 @@ getTCPDate(data, context) {
7463
```
7564

7665
> info **Hint** `@Payload()`, `@Ctx()`, `Transport` and `NatsContext` are imported from `@nestjs/microservices`.
66+
67+
#### Sharing configuration
68+
69+
By default a hybrid application will not inherit global pipes, interceptors, guards and filters configured for the main (HTTP-based) application.
70+
To inherit these configuration properties from the main application, set the `inheritAppConfig` property in the second argument (an optional options object) of the `connectMicroservice()` call, as follow:
71+
72+
```typescript
73+
const microservice = app.connectMicroservice({
74+
transport: Transport.TCP
75+
}, { inheritAppConfig: true });
76+
```

0 commit comments

Comments
 (0)