1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-28 17:57:37 +01:00
bitwarden-server/util/Server/Program.cs

36 lines
946 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
2017-09-08 17:45:20 +02:00
namespace Bit.Server
{
public class Program
{
public static void Main(string[] args)
{
var config = new ConfigurationBuilder()
.AddCommandLine(args)
.Build();
var builder = new WebHostBuilder()
.UseConfiguration(config)
.UseKestrel()
2018-09-11 19:29:34 +02:00
.UseStartup<Startup>();
var contentRoot = config.GetValue<string>("contentRoot");
if(string.IsNullOrWhiteSpace(contentRoot))
{
builder.UseContentRoot(contentRoot);
}
var webRoot = config.GetValue<string>("webRoot");
if(string.IsNullOrWhiteSpace(webRoot))
{
builder.UseWebRoot(webRoot);
}
var host = builder.Build();
host.Run();
}
}
}