Program.Main.cs 852 B

12345678910111213141516171819202122232425
  1. using GrpcService_CSharp.Services;
  2. namespace Company.WebApplication1;
  3. public class Program
  4. {
  5. public static void Main(string[] args)
  6. {
  7. var builder = WebApplication.CreateBuilder(args);
  8. // Additional configuration is required to successfully run gRPC on macOS.
  9. // For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
  10. // Add services to the container.
  11. builder.Services.AddGrpc();
  12. var app = builder.Build();
  13. // Configure the HTTP request pipeline.
  14. app.MapGrpcService<GreeterService>();
  15. app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909");
  16. app.Run();
  17. }
  18. }