Git Product home page Git Product logo

grpc-test's Introduction

grpc-test

grpc-test is a simple gRPC server and client implementation that utilizes a proto file to generate code for Go, JavaScript, and TypeScript and etc. The project also includes a REST gateway, which wraps around the gRPC server, enabling RESTful requests. Additionally, it uses Buf to manage protocol buffers.

Usage

Follow the steps below to build and run the gRPC server and client:

Prerequisites

Before you begin, ensure you have the following installed on your system:

  1. Go (https://golang.org/)
  2. Buf (https://docs.buf.build/installation)

Building and Running the Server

  1. Clone this repository to your local machine:

    git clone https://github.com/your-username/grpc-test.git
  2. Use the provided Makefile to build the server and client:

    make all
  3. Run the gRPC server:

    ./grpc-server

    The server will be up and running, listening on port 8000 for gRPC requests and port 9000 for RESTful requests.

RESTful Requests

The REST gateway wraps around the gRPC server, allowing you to make RESTful requests instead of gRPC calls directly. You can use tools like curl or Postman to interact with the server.

For example, to make a POST request to the server using curl:

curl -X POST -H "Content-Type: application/json" -d '{"Name": "Hello gRPC!"}' http://localhost:9000/hi

Generating Code

The project uses protocol buffers, and Buf is used to manage the proto files and code generation. Make sure to use Buf to lint and generate the proto files as needed.

Contributing

Feel free to contribute to this project by submitting pull requests or reporting issues. Your contributions are greatly appreciated!

License

This project is licensed under the MIT License.

Happy gRPC testing!

grpc-test's People

Contributors

sepehrsoh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.