REFACTOR: inputs inside its own module

This commit is contained in:
Gabriel Rosa
2022-08-11 14:28:10 -03:00
parent 430e09c159
commit 117704cd8c
20 changed files with 119 additions and 225 deletions
@@ -0,0 +1,28 @@
import { credentials } from '@grpc/grpc-js';
import {
ClientProviderOptions,
GrpcOptions,
Transport,
} from '@nestjs/microservices';
import { InputPackages, InputProtoFilePath } from 'protospack';
export class InputsGrpcClient {
private config: GrpcOptions = {
transport: Transport.GRPC,
options: {
url: process.env.INFACTORY_URL,
package: InputPackages,
credentials: process.env.LOCAL_ENV ? undefined : credentials.createSsl(),
protoPath: InputProtoFilePath,
loader: {
enums: String,
objects: true,
arrays: true,
},
},
};
providerOptions: ClientProviderOptions = {
name: 'InputsGrpcClient',
...this.config,
};
}