diff --git a/Gallery.Unified.Client/Program.cs b/Gallery.Unified.Client/Program.cs index c6a050d..1318ac2 100644 --- a/Gallery.Unified.Client/Program.cs +++ b/Gallery.Unified.Client/Program.cs @@ -6,4 +6,12 @@ .AddBrowserConsole() .SetMinimumLevel(LogLevel.Trace) ); + +builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); +// builder.Services.AddScoped(s => s.GetRequiredService()); + +var apiBaseUrl = builder.Configuration["ApiBaseUrl"] ?? builder.HostEnvironment.BaseAddress; +builder.Services.AddBlazorApiClient(apiBaseUrl); + + await builder.Build().RunAsync(); diff --git a/Gallery.Unified.Client/wwwroot/appsettings.Development.json b/Gallery.Unified.Client/wwwroot/appsettings.Development.json index 65f5b48..6f6bb94 100644 --- a/Gallery.Unified.Client/wwwroot/appsettings.Development.json +++ b/Gallery.Unified.Client/wwwroot/appsettings.Development.json @@ -5,5 +5,5 @@ "Microsoft.AspNetCore": "Warning" } }, - "ApiBaseUrl": "localhost:7086" + } diff --git a/Gallery.Unified/Program.cs b/Gallery.Unified/Program.cs index e5f0d2c..d2ae69b 100644 --- a/Gallery.Unified/Program.cs +++ b/Gallery.Unified/Program.cs @@ -44,19 +44,27 @@ app.UseHsts(); } -//app.UseBlazorFrameworkFiles(); - app.UseHttpsRedirection(); app.UseStaticFiles(); -app.UseRouting(); +// app.UseRouting(); app.UseServiceStack(new AppHost()); -app.MapRazorPages(); -app.MapControllers(); -app.MapFallbackToFile("index.html"); +// app.UseEndpoints(endpoints => +// { +// endpoints.MapRazorPages(); +// endpoints.MapControllers(); +// endpoints.MapFallbackToFile("index.html"); +// }); + +// app.MapRazorPages(); +// app.MapControllers(); +// app.MapFallbackToFile("index.html"); + +// app.UseBlazorFrameworkFiles(); + BlazorConfig.Set(new BlazorConfig {