Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.74 KB

README.md

File metadata and controls

65 lines (46 loc) · 1.74 KB
title keywords description
gRPC
grpc
server
client
Using Fiber as a client to a gRPC server.

Example for fiber as a client to gRPC server.

Github StackBlitz

A sample program to showcase fiber as a client to a gRPC server.

Prerequisites

  • Go 1.16 or higher
  • Go modules

Setup

  1. Clone the repository:

    git clone https://github.com/gofiber/recipes.git
    cd recipes/grpc
  2. Install dependencies:

    go mod tidy

Running the Application

  1. Run the gRPC server:

    go run server/main.go
  2. Run the Fiber client:

    go run client/main.go
  3. The server will start on http://localhost:3000.

Endpoints

Method URL Return value
GET /add/:a/:b a + b
GET /mult/:a/:b a * b

Output

-> curl http://localhost:3000/add/33445/443234
{"result":"476679"}
-> curl http://localhost:3000/mult/33445/443234
{"result":"14823961130"}

Additional Information

gRPC (gRPC Remote Procedure Calls) is a high-performance, open-source universal RPC framework initially developed by Google. It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authentication, load balancing, and more.

For more information, visit the official gRPC documentation.