@rhlsthrm/grpc-mock-server
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published

grpc-mock-server

gRPC mock server for tests with typescript definitions.

NPM CI

Usage example:

private static readonly PROTO_PATH: string = __dirname + "example.proto";
private static readonly PKG_NAME: string = "com.alenon.example";
private static readonly SERVICE_NAME: string = "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();

Package Sidebar

Install

npm i @rhlsthrm/grpc-mock-server

Weekly Downloads

2

Version

1.1.8

License

MIT

Unpacked Size

7.62 kB

Total Files

12

Last publish

Collaborators

  • rhlsthrm