7f78545a02
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
33 lines
965 B
C#
33 lines
965 B
C#
using DeepDrftWeb.Client.Clients;
|
|
using DeepDrftWeb.Client.ViewModels;
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
using NetBlocks.Models;
|
|
|
|
namespace DeepDrftWeb.Client;
|
|
|
|
public static class Startup
|
|
{
|
|
public static void ConfigureDomainServices(IServiceCollection services)
|
|
{
|
|
// Track Client
|
|
services.AddScoped<TrackClient>();
|
|
services.AddScoped<TracksViewModel>();
|
|
}
|
|
|
|
public static void ConfigureApiHttpClient(IServiceCollection services, string baseAddress)
|
|
{
|
|
services.AddHttpClient("DeepDrft.API", client =>
|
|
{
|
|
client.BaseAddress = new Uri(baseAddress);
|
|
});
|
|
}
|
|
|
|
public static void ConfigureCommonServices(IServiceCollection services, string contentApiUrl)
|
|
{
|
|
services.AddHttpClient("DeepDrft.Content", client =>
|
|
{
|
|
client.BaseAddress = new Uri(contentApiUrl);
|
|
});
|
|
services.AddScoped<TrackMediaClient>();
|
|
}
|
|
} |