forked from fullstackproltd/AspNetCoreSpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
33 lines (28 loc) · 990 Bytes
/
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
using System.IO;
using AspNetCoreSpa.Server;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore;
namespace AspNetCoreSpa
{
public class Program
{
public static void Main(string[] args)
{
var host = BuildWebHost(args);
// http://odetocode.com/blogs/scott/archive/2016/09/20/database-migrations-and-seeding-in-asp-net-core.aspx
ProcessDbCommands.Process(args, host);
host.Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseConfiguration(new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("hosting.json", optional: true)
.Build()
)
.UseStartup<Startup>()
.UseKestrel(a => a.AddServerHeader = false)
.Build();
}
}