File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
examples/grpc-proto-loader Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,12 @@ import { ProtoGrpcType } from './proto/example';
44import { ServerMessage } from './proto/example_package/ServerMessage' ;
55
66const host = '0.0.0.0:9090' ;
7- const packageDefinition = protoLoader . loadSync ( './proto/example.proto' ) ;
7+ const packageDefinition = protoLoader . loadSync ( './proto/example.proto' , {
8+ longs : String ,
9+ enums : String ,
10+ defaults : true ,
11+ oneofs : true ,
12+ } ) ;
813const proto = grpc . loadPackageDefinition (
914 packageDefinition
1015) as unknown as ProtoGrpcType ;
Original file line number Diff line number Diff line change @@ -53,7 +53,12 @@ const exampleServer: ExampleHandlers = {
5353} ;
5454
5555function getServer ( ) : grpc . Server {
56- const packageDefinition = protoLoader . loadSync ( './proto/example.proto' ) ;
56+ const packageDefinition = protoLoader . loadSync ( './proto/example.proto' , {
57+ longs : String ,
58+ enums : String ,
59+ defaults : true ,
60+ oneofs : true ,
61+ } ) ;
5762 const proto = grpc . loadPackageDefinition (
5863 packageDefinition
5964 ) as unknown as ProtoGrpcType ;
You can’t perform that action at this time.
0 commit comments