Add gRPC server example with file download
This commit is contained in:
26
TestGrpc/Startup.cs
Normal file
26
TestGrpc/Startup.cs
Normal 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>();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user