1

I have 2 GRPC services. And want create service which release Gateway Routing pattern. How i can do it ?

i use: .net 7 C# 11

I tried to ask a question to chagpt and he gave this result: but google doesn't know any exact entry for the method =))

enter image description here

services.AddGrpcGateway(options =>
{
    options.AddGateway("books", gateway =>
    {
        gateway.AddEndpoint("localhost:5001");
    });

    options.AddGateway("users", gateway =>
    {
        gateway.AddEndpoint("localhost:5003");
    });
});
padavan
  • 714
  • 8
  • 22
  • [gRPC JSON transcoding in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/grpc/json-transcoding?view=aspnetcore-7.0) may help. It describes how to annotate protobuf files so that a gRPC services can be exposed as HTTP/JSON. The document includes a summary of alternative approaches in [gRPC-Gateway](https://github.com/grpc-ecosystem/grpc-gateway/) – DazWilkin Jun 08 '23 at 23:18
  • @DazWilkin I have seen this, but I have not found how to do it from the code (as in my example). Not a single article about it. And the article you linked is more about Web request -> to GRPC format technique. – padavan Jun 09 '23 at 07:34

0 Answers0