Skip to content

Commit 25730d6

Browse files
committed
docs: provide option types for microservice in examples
1 parent 1767abb commit 25730d6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

content/faq/hybrid-application.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A hybrid application is one that both listens for HTTP requests, as well as make
44

55
```typescript
66
const app = await NestFactory.create(AppModule);
7-
const microservice = app.connectMicroservice({
7+
const microservice = app.connectMicroservice<MicroserviceOptions>({
88
transport: Transport.TCP,
99
});
1010

@@ -71,7 +71,7 @@ By default a hybrid application will not inherit global pipes, interceptors, gua
7171
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:
7272

7373
```typescript
74-
const microservice = app.connectMicroservice(
74+
const microservice = app.connectMicroservice<MicroserviceOptions>(
7575
{
7676
transport: Transport.TCP,
7777
},

content/microservices/basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function bootstrap() {
3838
bootstrap();
3939
@@switch
4040
import { NestFactory } from '@nestjs/core';
41-
import { Transport, MicroserviceOptions } from '@nestjs/microservices';
41+
import { Transport } from '@nestjs/microservices';
4242
import { AppModule } from './app.module';
4343

4444
async function bootstrap() {

content/microservices/kafka.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ The Kafka microservice components append a description of their respective role
371371

372372
```typescript
373373
@@filename(main)
374-
const app = await NestFactory.createMicroservice(AppModule, {
374+
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
375375
transport: Transport.KAFKA,
376376
options: {
377377
client: {

content/microservices/nats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ NATS provides a built-in load balancing feature called [distributed queues](http
7777

7878
```typescript
7979
@@filename(main)
80-
const app = await NestFactory.createMicroservice(AppModule, {
80+
const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
8181
transport: Transport.NATS,
8282
options: {
8383
servers: ['nats://localhost:4222'],

0 commit comments

Comments
 (0)