A repository for setting up gRPC, gRPC-Gateway, Buf and benchmarking.
Prerequisites
Clone the repository.bash
git clone [email protected]:firacloudtech/grpc-gateway-with-swagger-with-buf.git
Run
make buf-generate
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/
Update the SQL query in the sql/query.sql and run make sql-generate
For example,
-- name: CreateProduct :one INSERT INTO products (id, name, description, price, category, image_url, created_at, updated_at) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *;
In case there is a change in the swagger configuration for the echo-server, you would need to run the following command to the see the changes.
make echo-swagger-generate
To view the swagger docs for each service,