From 2f66807bc18de30f47a21c29b1b5351ef0382a05 Mon Sep 17 00:00:00 2001 From: mmrbnjd Date: Wed, 3 Sep 2025 20:05:35 +0330 Subject: [PATCH] app sett --- Presentation/HushianWebApp/Program.cs | 4 ++-- Presentation/HushianWebApp/wwwroot/appsettings.json | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Presentation/HushianWebApp/wwwroot/appsettings.json diff --git a/Presentation/HushianWebApp/Program.cs b/Presentation/HushianWebApp/Program.cs index 55e72d6..f14acd2 100644 --- a/Presentation/HushianWebApp/Program.cs +++ b/Presentation/HushianWebApp/Program.cs @@ -7,8 +7,8 @@ using HushianWebApp.Service; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); - -builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:8080/api/") }); +string BaseAddress=builder.Configuration.GetSection("BaseAddress").Value; +builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(BaseAddress) }); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/Presentation/HushianWebApp/wwwroot/appsettings.json b/Presentation/HushianWebApp/wwwroot/appsettings.json new file mode 100644 index 0000000..9a6d278 --- /dev/null +++ b/Presentation/HushianWebApp/wwwroot/appsettings.json @@ -0,0 +1,10 @@ +{ + "BaseAddress": "http://localhost:8080/api/", + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} \ No newline at end of file