https://github.com/alenon/grpc-mock-server
gRPC mock server written in typescript
https://github.com/alenon/grpc-mock-server
grpc javascript mock server typescript
Last synced: about 1 month ago
JSON representation
gRPC mock server written in typescript
- Host: GitHub
- URL: https://github.com/alenon/grpc-mock-server
- Owner: alenon
- License: mit
- Created: 2019-03-13T18:55:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-09-23T12:11:14.000Z (4 months ago)
- Last Synced: 2025-09-23T14:21:36.794Z (4 months ago)
- Topics: grpc, javascript, mock, server, typescript
- Language: TypeScript
- Size: 1.5 MB
- Stars: 22
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# grpc-mock-server
gRPC mock server for tests with typescript definitions.

Installation:
[NPM link](https://www.npmjs.com/package/@alenon/grpc-mock-server)
`npm i @alenon/grpc-mock-server`
Usage example:
```typescript
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();
```