-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
47 lines (43 loc) · 1.42 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
44
45
46
47
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System.Threading;
using Microsoft.EntityFrameworkCore;
using fastmusic.DataProviders;
using fastmusic.DataTypes;
namespace fastmusic
{
/// <summary>
/// Entry point class
/// </summary>
public class Program
{
/// <summary>
/// Entry point method
/// </summary>
/// <param name="args">Command line arguments for the program.</param>
public static void Main(string[] args)
{
var config = ConfigLoader.GetConfig();
var libMon = LibraryMonitor.GetInstance(config.LibraryLocations, config.MimeTypes.Keys.ToList());
BuildWebHost(args, config).Run();
}
/// <summary>
/// Builds the ASP.NET core side of the program.
/// </summary>
/// <param name="args">Command line arguments for the program.</param>
/// <param name="config">User configuration (loaded from disk).</param>
/// <returns></returns>
public static IWebHost BuildWebHost(string[] args, Config config) =>
WebHost.CreateDefaultBuilder(args)
.UseUrls(config.URL)
.UseStartup<Startup>()
.Build();
}
}