2020-01-26 00:57:02 +08:00
|
|
|
#region snippet_1
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddGrpc();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Configure(IApplicationBuilder app)
|
|
|
|
{
|
|
|
|
app.UseRouting();
|
|
|
|
|
2020-02-08 09:37:19 +08:00
|
|
|
app.UseGrpcWeb(); // Must be added between UseRouting and UseEndpoints
|
2020-01-26 00:57:02 +08:00
|
|
|
|
|
|
|
app.UseEndpoints(endpoints =>
|
|
|
|
{
|
|
|
|
endpoints.MapGrpcService<GreeterService>().EnableGrpcWeb();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
#endregion
|