// Server
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.GRPC,
options: {
url: process.env.NODE_ENV !== "local" ? "0.0.0.0:50051" : "localhost:5000",
package: ["<package_name>"],
protoPath: ["node_modules/crm-prototypes/interfaces/<package_name>.proto"],
maxReceiveMessageLength: 1024 * 1024 * 1024,
maxSendMessageLength: 1024 * 1024 * 1024,
},
});
// Client
@Client({
transport: Transport.GRPC,
options: {
url: process.env.<GRPC_ENV>,
package: '<package_name>',
protoPath: 'node_modules/crm-prototypes/interfaces/<package_name>.proto',
maxReceiveMessageLength: 1024 * 1024 * 1024,
maxSendMessageLength: 1024 * 1024 * 1024,
},
})
private client: ClientGrpc;