-
Notifications
You must be signed in to change notification settings - Fork 1
/
Startup.cs
52 lines (46 loc) · 1.89 KB
/
Startup.cs
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// joeshakely
using allmylinks.Services.UserPreferences;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Logging.Abstractions;
using Stl.Fusion;
using Stl.Fusion.Authentication;
using Stl.Fusion.Blazor;
using Stl.Fusion.Client;
namespace allmylinks
{
public class Startup
{
private IConfiguration Cfg { get; }
private IWebAssemblyHostEnvironment Env { get; }
private ILogger Log { get; set; } = NullLogger<Startup>.Instance;
public Startup(IConfiguration configuration, IWebAssemblyHostEnvironment env)
{
Cfg = configuration;
}
public static void ConfigureServices(IServiceCollection services, WebAssemblyHostBuilder builder)
{
services.AddLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
logging.SetMinimumLevel(LogLevel.None);
logging.AddFilter("Microsoft", LogLevel.None);
logging.AddFilter("Microsoft.AspNetCore.Hosting", LogLevel.None);
logging.AddFilter("Microsoft.EntityFrameworkCore.Database.Command", LogLevel.None);
logging.AddFilter("Stl.Fusion.Operations", LogLevel.None);
});
var baseUri = new Uri(builder.HostEnvironment.BaseAddress);
var apiBaseUri = new Uri($"{baseUri}api/");
var fusion = services.AddFusion();
fusion.AddComputeService<IUserPreferencesService, UserPreferencesService>();
// var fusionClient = fusion.AddRestEaseClient(
// (c, o) =>
// {
// o.BaseUri = baseUri;
// o.IsLoggingEnabled = true;
// o.IsMessageLoggingEnabled = false;
// });
var fusionAuth = fusion.AddAuthentication().AddRestEaseClient().AddBlazor();
}
}
}