{"id":15518054,"url":"https://github.com/iamrajiv/helloworld-grpc-gateway-example","last_synced_at":"2026-05-04T03:33:44.706Z","repository":{"id":230850587,"uuid":"681769806","full_name":"iamrajiv/helloworld-grpc-gateway-example","owner":"iamrajiv","description":"This repository contains an example of how to use the gRPC-Gateway.","archived":false,"fork":false,"pushed_at":"2023-08-22T18:30:45.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T19:51:01.711Z","etag":null,"topics":["go","grpc","grpc-gateway","protobuf","rest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamrajiv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-08-22T18:09:43.000Z","updated_at":"2023-11-09T05:04:55.000Z","dependencies_parsed_at":"2024-04-01T07:20:35.487Z","dependency_job_id":"b6143557-2d32-496e-a0e6-8f9b3d184e24","html_url":"https://github.com/iamrajiv/helloworld-grpc-gateway-example","commit_stats":null,"previous_names":["iamrajiv/helloworld-grpc-gateway-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iamrajiv/helloworld-grpc-gateway-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajiv%2Fhelloworld-grpc-gateway-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajiv%2Fhelloworld-grpc-gateway-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajiv%2Fhelloworld-grpc-gateway-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajiv%2Fhelloworld-grpc-gateway-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamrajiv","download_url":"https://codeload.github.com/iamrajiv/helloworld-grpc-gateway-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamrajiv%2Fhelloworld-grpc-gateway-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32593943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","grpc","grpc-gateway","protobuf","rest"],"created_at":"2024-10-02T10:14:49.391Z","updated_at":"2026-05-04T03:33:44.689Z","avatar_url":"https://github.com/iamrajiv.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"assets/helloworld-grpc-gateway-example.svg\" height=\"auto\" width=\"400\" /\u003e\n\u003cbr /\u003e\n\u003ch1\u003eHello World gRPC-Gateway Example\u003c/h1\u003e\n\u003cp\u003e\n\n\u003c/p\u003e\n\u003ca href=\"https://github.com/iamrajiv/helloworld-grpc-gateway-example/network/members\"\u003e\u003cimg src=\"https://img.shields.io/github/forks/iamrajiv/helloworld-grpc-gateway-example?color=0969da\u0026style=for-the-badge\" height=\"auto\" width=\"auto\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/iamrajiv/helloworld-grpc-gateway-example/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/iamrajiv/helloworld-grpc-gateway-example?color=0969da\u0026style=for-the-badge\" height=\"auto\" width=\"auto\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/iamrajiv/helloworld-grpc-gateway-example/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/iamrajiv/helloworld-grpc-gateway-example?color=0969da\u0026style=for-the-badge\" height=\"auto\" width=\"auto\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## About\n\nThis repository contains an example of how to use the [gRPC-Gateway](https://github.com/grpc-ecosystem/grpc-gateway).\n\n## Usage\n\n#### Generating Protobuf and gRPC-Gateway Code\n\nTo generate the protobuf and gRPC-Gateway code, you can use the buf tool. The protobuf files are stored in the proto directory, and the generated code will be placed in the internal directory.\n\nTo generate the code, run the following command:\n\n```shell\nmake generate\n```\n\nThis will generate the necessary Go code for the protobuf files and the gRPC-Gateway files.\n\n#### gRPC Requests and Responses\n\nOnce you've started both the gRPC and gRPC-Gateway servers using `go run main.go`, you can send gRPC requests and receive responses using a gRPC client.\n\nHere's an example of how to send a gRPC request and receive a response using the `grpcurl` command-line tool:\n\n1. Install `grpcurl` by following the instructions in the [official documentation](https://github.com/fullstorydev/grpcurl#installation).\n2. Open a new terminal window or tab and run the following command to send a gRPC request to the `SayHello` RPC:\n\n```shell\ngrpcurl -plaintext -d '{\"name\": \"Rajiv\"}' localhost:8080 helloworld.v1.GreeterService/SayHello\n```\n\nThis sends a gRPC request to the `SayHello` RPC with the name \"Rajiv\" as a request parameter.\n\n3. You should receive a response that looks like this:\n\n```shell\n{\n  \"message\": \"Hello, Rajiv!\"\n}\n```\n\nThis is the response message returned by the `SayHello` RPC.\n\n#### REST Requests and Responses\n\nOnce you've started both the gRPC and gRPC-Gateway servers using `go run main.go`, you can send REST requests and receive responses using a tool like `curl`.\n\nHere's an example of how to send a REST request and receive a response using `curl`:\n\n1. Open a new terminal window or tab and run the following command to send a REST request to the `/v1/helloworld` endpoint:\n\n```shell\ncurl -X POST http://localhost:8081/v1/helloworld -H \"Content-Type: application/json\" -d '{\"name\": \"Rajiv\"}'\n```\n\nThis sends a `POST` request to the `/v1/helloworld` endpoint with a JSON payload containing the name \"Rajiv\".\n\n2. You should receive a response that looks like this:\n\n```shell\n{\n  \"message\": \"Hello, Rajiv!\"\n}\n```\n\n## License\n\n[MIT](https://github.com/iamrajiv/helloworld-grpc-gateway-example/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrajiv%2Fhelloworld-grpc-gateway-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamrajiv%2Fhelloworld-grpc-gateway-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamrajiv%2Fhelloworld-grpc-gateway-example/lists"}