mirror of https://github.com/dapr/dotnet-sdk.git
51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
// ------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
// ------------------------------------------------------------
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
namespace GrpcServiceSample
|
|
{
|
|
/// <summary>
|
|
/// GrpcService Sample
|
|
/// </summary>
|
|
public class Program
|
|
{
|
|
/// <summary>
|
|
/// Entry point
|
|
/// </summary>
|
|
/// <param name="args"></param>
|
|
public static void Main(string[] args)
|
|
{
|
|
CreateHostBuilder(args).Build().Run();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Creates WebHost Builder.
|
|
/// </summary>
|
|
/// <param name="args"></param>
|
|
/// <returns></returns>
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
Host.CreateDefaultBuilder(args)
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
{
|
|
webBuilder.ConfigureKestrel(options =>
|
|
{
|
|
// Setup a HTTP/2 endpoint without TLS.
|
|
options.ListenLocalhost(5050, o => o.Protocols =
|
|
HttpProtocols.Http2);
|
|
});
|
|
|
|
webBuilder.UseStartup<Startup>();
|
|
});
|
|
}
|
|
}
|