Http w/ dispatch

This commit is contained in:
rafi1212122
2023-05-24 17:18:36 +07:00
parent df32db9a60
commit 8343f08f90
15 changed files with 708 additions and 12 deletions

24
HttpServer/Program.cs Normal file
View File

@@ -0,0 +1,24 @@
using Common;
using HttpServer.Controllers;
namespace HttpServer
{
public class Program
{
public static void Main()
{
Thread.CurrentThread.IsBackground = true;
var builder = WebApplication.CreateBuilder();
var app = builder.Build();
app.UsePathBase("/");
app.Urls.Add($"http://*:{Global.config.Http.HttpPort}");
app.Urls.Add($"https://*:{Global.config.Http.HttpsPort}");
DispatchController.AddHandlers(app);
app.Run();
}
}
}