/
Program.cs
39 lines (35 loc) · 1.06 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace BackgroundDatabaseLogger
{
public class Program
{
public static async Task Main(string[] args)
{
var commandLoopTask = Task.Run(() => CommandLoop());
var builder = Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseKestrel()
.UseStartup<Startup>()
.UseUrls("https://localhost:12345")
.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders());
});
await Task.WhenAny(builder.RunConsoleAsync(), commandLoopTask);
}
private static void CommandLoop()
{
Console.WriteLine("CommandLoop starting");
while (true)
{
var input = Console.ReadLine();
}
}
}
}