-
Notifications
You must be signed in to change notification settings - Fork 24
/
Program.cs
43 lines (37 loc) · 1.46 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
namespace Dapr.Tests.HashTagApp
{
using Dapr.Tests.Common;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
public class Program
{
public static void Main(string[] args)
{
ObservabilityUtils.StartMetricsServer();
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) {
var hostBuilder = Host.CreateDefaultBuilder(args)
.ConfigureTestInfraLogging()
.ConfigureWebHostDefaults(webBuilder =>
{
var appSettings = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile($"appsettings.json", optional: true, reloadOnChange: true)
.AddCommandLine(args)
.Build();
var host = webBuilder.UseStartup<Startup>()
.UseUrls(urls: $"http://*:{appSettings[AppSettings.DaprHTTPAppPort]}");
});
return hostBuilder;
}
}
}