From 9986739ce82775c63a079d1a4efadb1dad8ba147 Mon Sep 17 00:00:00 2001 From: smartwyy <645583145@qq.com> Date: Thu, 30 May 2024 16:42:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E9=85=8D=E7=BD=AE5035?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebStarter/Program.cs | 7 ++++++- WebStarter/appsettings.json | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 52047e9..62c75a0 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -90,8 +90,13 @@ app.UseAuthorization(); app.UseCors("myCors"); app.MapControllers(); -AppInfo.Container = app.Services.GetAutofacRoot(); +var list = AppSettingsHelper.GetContent("Kestrel", "Endpoints", "http", "Url"); +foreach (var s in list.Split(";")) +{ + app.Urls.Add(s); +} +AppInfo.Container = app.Services.GetAutofacRoot(); ClientMgr.InitClient(); app.Run(); \ No newline at end of file diff --git a/WebStarter/appsettings.json b/WebStarter/appsettings.json index c8ae7a4..3bd6db4 100644 --- a/WebStarter/appsettings.json +++ b/WebStarter/appsettings.json @@ -20,5 +20,12 @@ "Microsoft.AspNetCore": "Warning" } }, + "Kestrel": { + "Endpoints": { + "http": { + "Url": "http://0.0.0.0:5035" + } + } + }, "AllowedHosts": "*" }