This commit is contained in:
@@ -27,11 +27,7 @@ using LogDashboard;
|
||||
|
||||
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
#region 环境变量设置,以及部署运维平台
|
||||
|
||||
#region 获取环境变量
|
||||
//以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
|
||||
var config = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
@@ -48,11 +44,19 @@ if (string.IsNullOrWhiteSpace(enviromentName))
|
||||
: "Development";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
|
||||
{
|
||||
EnvironmentName = enviromentName
|
||||
});
|
||||
|
||||
#region 主机配置
|
||||
|
||||
|
||||
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||
|
||||
builder.Host.UseEnvironment(enviromentName)
|
||||
builder.Host
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user