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