@@ -19,14 +19,14 @@ To use the NATS transporter, pass the following options object to the `createMic
19
19
const app = await NestFactory .createMicroservice <MicroserviceOptions >(AppModule , {
20
20
transport: Transport .NATS ,
21
21
options: {
22
- url: ' nats://localhost:4222' ,
22
+ servers: [ ' nats://localhost:4222' ] ,
23
23
},
24
24
});
25
25
@@switch
26
26
const app = await NestFactory .createMicroservice (AppModule , {
27
27
transport: Transport .NATS ,
28
28
options: {
29
- url: ' nats://localhost:4222' ,
29
+ servers: [ ' nats://localhost:4222' ] ,
30
30
},
31
31
});
32
32
```
@@ -52,7 +52,7 @@ One method for creating an instance is to use the `ClientsModule`. To create a c
52
52
name: ' MATH_SERVICE' ,
53
53
transport: Transport .NATS ,
54
54
options: {
55
- url: ' nats://localhost:4222' ,
55
+ servers: [ ' nats://localhost:4222' ] ,
56
56
}
57
57
},
58
58
]),
@@ -80,7 +80,7 @@ NATS provides a built-in load balancing feature called [distributed queues](http
80
80
const app = await NestFactory .createMicroservice (AppModule , {
81
81
transport: Transport .NATS ,
82
82
options: {
83
- url: ' nats://localhost:4222' ,
83
+ servers: [ ' nats://localhost:4222' ] ,
84
84
queue: ' cats_queue' ,
85
85
},
86
86
});
0 commit comments