I am a beginner in GRPC and nodejs. For the first time, I use protoloader to load my services from proto. Then, I want to switch to use generated files from grpc: in my case I have: comment_pb.js, So I replace this code with:
import protoLoader from '@grpc/proto-loader';
const packageDefinition = protoLoader.loadSync('../../../protos/comment.proto', {
keepCase: true,
longs: String,
enums: String,
arrays: true
});
//pass proto in grpc
var commentProto = grpc.loadPackageDefinition(packageDefinition);
With:
import protoLoader from './proto/comment_pb.js';
I don't know what's the diff between these two methods, does this change and impact the rest of the code? there are any helpful links about this.