Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@alenon/grpc-mock-server

1.1.8 • Public • Published

grpc-mock-server

gRPC mock server for tests with typescript definitions.

NPM CI

Usage example:

private static readonly PROTO_PATHstring = __dirname + "example.proto";
private static readonly PKG_NAMEstring = "com.alenon.example";
private static readonly SERVICE_NAMEstring = "ExampleService";
 
...
    
const implementations = {
    ex1: (call: any, callback: any) => {
        const response: any =
            new this.proto.ExampleResponse.constructor({msg: "the response message"});
        callback(null, response);
    },
};
 
this.server.addService(PROTO_PATH, PKG_NAME, SERVICE_NAME, implementations);
this.server.start();

Install

npm i @alenon/grpc-mock-server

DownloadsWeekly Downloads

2

Version

1.1.8

License

MIT

Unpacked Size

2.94 kB

Total Files

3

Last publish

Collaborators

  • avatar