*Audio Playback*
Content API: - Enabling CORS for access from Blazor app Web Server: - Content API URL environment config - Web Audio API JS Interop layer in TypeScript - HttpClient configs Web Client: - Audio Tack player controls - Audio Player example page - Audio Interop Service Layer - Named HttpClients
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using DeepDrftWeb;
|
||||
using DeepDrftWeb.Client.Services;
|
||||
using MudBlazor.Services;
|
||||
using DeepDrftWeb.Components;
|
||||
|
||||
@@ -7,13 +8,16 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
// Add MudBlazor services
|
||||
builder.Services.AddMudServices();
|
||||
|
||||
// Add HttpClient services for prerendering
|
||||
builder.Services.AddHttpClient("DeepDrft.API", client => client.BaseAddress = new Uri(Startup.GetKestrelUrl(builder)));
|
||||
builder.Services.AddScoped(sp =>
|
||||
sp.GetRequiredService<IHttpClientFactory>().CreateClient("DeepDrft.API"));
|
||||
// Add AudioInteropService for both server and client rendering
|
||||
builder.Services.AddScoped<AudioInteropService>();
|
||||
|
||||
var baseUrl = Startup.GetKestrelUrl(builder);
|
||||
var contentApiUrl = builder.Configuration["ApiUrls:ContentApi"] ?? "https://localhost:7001";
|
||||
|
||||
Startup.ConfigureDomainServices(builder);
|
||||
|
||||
DeepDrftWeb.Client.Startup.ConfigureApiHttpClient(builder.Services, baseUrl);
|
||||
DeepDrftWeb.Client.Startup.ConfigureCommonServices(builder.Services, contentApiUrl);
|
||||
DeepDrftWeb.Client.Startup.ConfigureDomainServices(builder.Services);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
||||
Reference in New Issue
Block a user