Skip to content

no docker needed grpc mock server for mocking simple grpc requests.

Notifications You must be signed in to change notification settings

alishi973/grpc-mock-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy-to-Use gRPC Mock Server for use with grpc-web.

How to get start:

  1. Clone this repo:
git clone https://github.com/alishi973/grpc-mock-server
  1. Put your .proto files on /proto folder in the main directory.
  2. Create mock-response.json on the main directory and write your message rpc in JSON format.

Example

{
    "LoginResponse": {
        "token": "abcdefg"
    }
}
  1. Install dependecy yarn install or npm install
  2. Run server with npm start or yarn start

Now gRPC mocked server is ready on port 50051 and proxified server for web application are up on 8080 ports on your machine.

Current proxy is cloned of grpcwebproxy.

You can use bloomRPC for testing mocked server.

Important note for using on web app 🚧

Remember to change proxy:start script on package.json and write your served web application address for allowed_origins parameter (default address is http://localhost:3000)

Last but not least

For using this repo on non Windows OS, you need to replace grpcwebproxy.exe file with your relative reverse proxy and also change name of this file in package.json on proxy:start script (You can find here).

and maybe need some change for unix file addressing.

About

no docker needed grpc mock server for mocking simple grpc requests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published