mirror of
https://github.com/bitwarden/server
synced 2025-12-13 06:43:45 +00:00
create kestrel server for serving static files
This commit is contained in:
27
util/Server/Program.cs
Normal file
27
util/Server/Program.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = new WebHostBuilder()
|
||||
.UseKestrel()
|
||||
.UseStartup<Startup>();
|
||||
|
||||
if(args.Length > 0)
|
||||
{
|
||||
builder.UseContentRoot(args[0]);
|
||||
}
|
||||
|
||||
if(args.Length > 1)
|
||||
{
|
||||
builder.UseWebRoot(args[1]);
|
||||
}
|
||||
|
||||
var host = builder.Build();
|
||||
host.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user