Skip to content

yogenpoonudurai/gRPC-gateway-with-swagger-and-buf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC-gateway-with-swagger-and-buf

A repository for setting up gRPC, gRPC-Gateway, Buf and benchmarking.

Prerequisites

Setting up gRPC

Clone the repository.bash

git clone [email protected]:firacloudtech/grpc-gateway-with-swagger-with-buf.git

Register a Buf account and follow the instruction to update your BUF_USER environment variable. Replace $BUF_USER with your own buf profile name. BSR

Push the build to BSR and update the import paths with with your BUF prod

package main

import (
	"context"
	"fmt"
	"log"

	orderv1 `github.com/$BUF_USER/grpc-grpc-gateway-swagger-buf/gen/go/order/v1`
	productv1 "github.com/$BUF_USER/grpc-grpc-gateway-swagger-buf/gen/go/product/v1")

Run the following command.

make buf-generate
make buf-push

To run the grpc server and grpc-gateway, Run

make run-server

To run the grpc client, Run

make run-client

To view the swagger documentation, go to http://127.0.0.1:3001/docs/

About

A starter kit for gRPC, gRPC-gateway, buf and swagger

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published