Methods
-
initHttp() → {void}
-
Description
Initialize HTTP server at specified port
Returns
Details
-
initHttps( key, cert ) → {void}
-
Description
Initialize HTTPs server at specified port
Parameters
Name Type Description keystring location of server.key file
certstring location of server.cert file
Returns
Details
-
initGrpc( grpcProtosDir, grpcMocksDir, grpcHost, grpcPort )
-
Description
Initializes a gRPC server at specified host and port
- Set location of gRPC mocks to be used by metod camouflageMock
- Get an array of all .protofile in specified protos directory
- Run forEach on the array and read and load package definition for each protofile in protos dir
- For each definition, get the package details from all .proto files and store in a master packages object
- Initialize a grpcServer
- Create an insecure binding to given grpc host and port, and start the server
- For each package, filter out objects with service definition, discard rest
- For each method in the service definition, attach a generic handler, finally add service to running server
- Handlers will vary based on the type of request, i.e. unary, bidi streams or one sided streams
- Finally add all services to the server
Parameters
Name Type Description grpcProtosDirstring location of proto files
grpcMocksDirstring location of mock files for grpc
grpcHoststring grpc host
grpcPortnumber grpc port
Details
-
initHttp2( http2Port, http2key, http2cert )
-
Description
Initializes an HTTP2 server
Parameters
Name Type Description http2Portnumber http2keystring http2certstring Details
-
initws( wsPort, wsMockDir )
-
Description
Initializes a WebSocketserver
Parameters
Name Type Description wsPortnumber wsMockDirstring Details