2020-10-26 16:20:47 +02:00
|
|
|
using System.Threading.Tasks;
|
2020-10-26 17:06:29 +02:00
|
|
|
using MalwareMultiScan.Backends.Enums;
|
|
|
|
using MalwareMultiScan.Backends.Extensions;
|
|
|
|
using MalwareMultiScan.Scanner.Services;
|
2020-10-26 16:20:47 +02:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
|
|
|
namespace MalwareMultiScan.Scanner
|
|
|
|
{
|
|
|
|
public static class Program
|
|
|
|
{
|
|
|
|
public static async Task Main(string[] args)
|
|
|
|
{
|
|
|
|
await Host.CreateDefaultBuilder(args)
|
|
|
|
.ConfigureAppConfiguration(configure =>
|
|
|
|
{
|
2020-10-26 17:06:29 +02:00
|
|
|
configure.AddJsonFile("appsettings.json");
|
2020-10-26 16:20:47 +02:00
|
|
|
configure.AddEnvironmentVariables();
|
|
|
|
})
|
|
|
|
.ConfigureServices((context, services) =>
|
|
|
|
{
|
|
|
|
services.AddLogging();
|
|
|
|
|
|
|
|
services.AddScanningBackend(
|
|
|
|
context.Configuration.GetValue<BackendType>("BackendType"));
|
|
|
|
|
|
|
|
services.AddHostedService<ScanHostedService>();
|
|
|
|
}).RunConsoleAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|