AspNetCore.Docs/aspnetcore/grpc/test-tools/Startup.cs

23 lines
458 B
C#
Raw Normal View History

2020-09-16 05:29:38 +08:00
#region snippet_1
public void ConfigureServices(IServiceCollection services)
{
services.AddGrpc();
services.AddGrpcReflection();
}
2020-09-17 17:35:27 +08:00
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
2020-09-16 05:29:38 +08:00
{
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcService<GreeterService>();
2020-09-17 17:35:27 +08:00
if (env.IsDevelopment())
{
endpoints.MapGrpcReflectionService();
}
2020-09-16 05:29:38 +08:00
});
}
#endregion