From e063225129468e08de08b05f7abcfffeb4e93c61 Mon Sep 17 00:00:00 2001 From: Toby Burns Date: Thu, 29 Aug 2024 17:12:45 -0400 Subject: [PATCH] Add api uri --- Client/Model/Program.cs | 3 ++- Client/wwwroot/appsettings.development.json | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Client/wwwroot/appsettings.development.json diff --git a/Client/Model/Program.cs b/Client/Model/Program.cs index e1c9370..0a735b0 100644 --- a/Client/Model/Program.cs +++ b/Client/Model/Program.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using Microsoft.Extensions.DependencyInjection; using MudBlazor.Services; using PersonalWebsite.Client; using PersonalWebsite.Shared.Contact; @@ -17,7 +18,7 @@ builder.Services.AddHttpClient("local", (h) => h.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)); builder.Services.AddHttpClient("api", - (h) => h.BaseAddress = new Uri(builder.Configuration["Api_Uri"] ?? "http://localhost:7071")); + (h) => h.BaseAddress = new Uri(builder.Configuration["Api_Uri"] ?? builder.HostEnvironment.BaseAddress)); // TODO: Replace this with a proper http rest service builder.Services.AddHttpClient("local"); diff --git a/Client/wwwroot/appsettings.development.json b/Client/wwwroot/appsettings.development.json new file mode 100644 index 0000000..9d653ac --- /dev/null +++ b/Client/wwwroot/appsettings.development.json @@ -0,0 +1,3 @@ +{ + "Api_Uri": "http://localhost:7071" +} \ No newline at end of file