-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProgram.cs
34 lines (33 loc) · 1.37 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
using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.WindowsAzure.Storage; // Namespace for Storage Client Library
using Microsoft.Extensions.Configuration;
using Microsoft.WindowsAzure.Storage.File; // Namespace for Azure File storage
namespace PlayList
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureAppConfiguration((hostContext, config) =>
{
IHostingEnvironment env = hostContext.HostingEnvironment;
// delete all default configuration providers
config.Sources.Clear();
config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
.AddJsonFile("config.json", optional: false, reloadOnChange: true)
.SetBasePath(env.ContentRootPath)
.AddEnvironmentVariables();
})
.Build();
}
}