feat: build blazor client UI and PWA assets
This commit is contained in:
19
src/ASTRAIN.Client/Program.cs
Normal file
19
src/ASTRAIN.Client/Program.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using ASTRAIN.Client;
|
||||
using ASTRAIN.Client.Services;
|
||||
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
var apiBaseAddress = builder.Configuration["ApiBaseAddress"];
|
||||
var baseAddress = string.IsNullOrWhiteSpace(apiBaseAddress)
|
||||
? builder.HostEnvironment.BaseAddress
|
||||
: apiBaseAddress;
|
||||
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(baseAddress) });
|
||||
builder.Services.AddScoped<ApiClient>();
|
||||
builder.Services.AddScoped<UserContext>();
|
||||
|
||||
await builder.Build().RunAsync();
|
||||
Reference in New Issue
Block a user