File tree 2 files changed +12
-2
lines changed
examples/grpc-proto-loader
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';
4
4
import { ServerMessage } from './proto/example_package/ServerMessage' ;
5
5
6
6
const 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
+ } ) ;
8
13
const proto = grpc . loadPackageDefinition (
9
14
packageDefinition
10
15
) as unknown as ProtoGrpcType ;
Original file line number Diff line number Diff line change @@ -53,7 +53,12 @@ const exampleServer: ExampleHandlers = {
53
53
} ;
54
54
55
55
function 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
+ } ) ;
57
62
const proto = grpc . loadPackageDefinition (
58
63
packageDefinition
59
64
) as unknown as ProtoGrpcType ;
You can’t perform that action at this time.
0 commit comments