Add gRPC server example with file download

This commit is contained in:
2024-09-25 19:27:20 +02:00
commit 179d4a8dc4
14 changed files with 480 additions and 0 deletions

26
TestGrpc/Startup.cs Normal file
View File

@@ -0,0 +1,26 @@
using TestGrpc.Services;
namespace TestGrpc;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddGrpc(o => o.EnableDetailedErrors = true);
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcService<GreeterService>();
});
}
}