mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 22:48:42 +00:00
18 lines
412 B
C#
18 lines
412 B
C#
|
|
|
|
using Echo;
|
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.WebHost.ConfigureKestrel(o =>
|
|
{
|
|
// Listen on 5300 and force HTTP/2 (h2c)
|
|
o.ListenAnyIP(5300, lo => lo.Protocols = HttpProtocols.Http2);
|
|
});
|
|
|
|
builder.Services.AddGrpc();
|
|
var app = builder.Build();
|
|
app.MapGrpcService<EchoServiceImpl>();
|
|
app.Urls.Add("http://0.0.0.0:5300");
|
|
app.Run(); |