docs(grpc-reflection): updated reflection example to reflect on the reflection API itself

This commit is contained in:
Justin Timmons 2023-11-27 21:20:02 -05:00
parent c53656d67b
commit 8016d8758b
1 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,11 @@ var grpc = require('@grpc/grpc-js');
var protoLoader = require('@grpc/proto-loader');
var reflection = require('@grpc/reflection');
var PROTO_PATH = path.join(__dirname, '../protos/helloworld.proto');
var PROTO_PATH = [
path.join(__dirname, '../protos/helloworld.proto'),
require.resolve('@grpc/reflection/build/proto/grpc/reflection/v1/reflection.proto'),
require.resolve('@grpc/reflection/build/proto/grpc/reflection/v1alpha/reflection.proto')
];
var server = new grpc.Server();
var packageDefinition = protoLoader.loadSync(PROTO_PATH);