-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
28 lines (23 loc) · 1.21 KB
/
Copy pathProgram.cs
File metadata and controls
28 lines (23 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using SpawnDev.BlazorJS;
using SpawnDev.BlazorJS.Cryptography;
using SpawnWear.Bridge;
using SpawnWear.Companion;
using SpawnWear.Companion.Services;
// Print build timestamp on startup so the running build can be verified at a
// glance via DevTools console - matches the pattern across every other SpawnDev
// Blazor WASM app. Same value is exposed via BuildInfo.Timestamp for in-page UI.
Console.WriteLine($"SpawnWear.Companion build {BuildInfo.Timestamp}");
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddBlazorJSRuntime();
builder.Services.AddSpawnWearBridge();
builder.Services.AddPlatformCrypto(); // SpawnDev.BlazorJS.Cryptography - browser-side IPortableCrypto
builder.Services.AddScoped<WatchPrefs>();
builder.Services.AddScoped<SpawnWear.Bridge.Pairing.IPairingStore, LocalStoragePairingStore>();
await builder.Build().BlazorJSRunAsync();