mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feat(microservices): move getTransportId functions to public variable transportId and make it optional
This commit is contained in:
@@ -19,6 +19,7 @@ let natsPackage: any = {};
|
||||
export class ServerNats extends Server implements CustomTransportStrategy {
|
||||
private readonly url: string;
|
||||
private natsClient: Client;
|
||||
public readonly transportId: Transport = Transport.NATS;
|
||||
|
||||
constructor(private readonly options: NatsOptions['options']) {
|
||||
super();
|
||||
@@ -32,10 +33,6 @@ export class ServerNats extends Server implements CustomTransportStrategy {
|
||||
this.initializeDeserializer(options);
|
||||
}
|
||||
|
||||
public getTransport(): number {
|
||||
return Transport.NATS;
|
||||
}
|
||||
|
||||
public listen(callback: () => void) {
|
||||
this.natsClient = this.createNatsClient();
|
||||
this.handleError(this.natsClient);
|
||||
|
||||
Reference in New Issue
Block a user