-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathProgram.cs
24 lines (21 loc) · 1.03 KB
/
Program.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
using Blazorcrud.Client;
using Blazorcrud.Client.Services;
using Blazorcrud.Client.Shared;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped<IPersonService, PersonService>();
builder.Services.AddScoped<IUploadService, UploadService>();
builder.Services.AddScoped<IAlertService, AlertService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddScoped<IHttpService, HttpService>();
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
builder.Services.AddScoped(x => {
var apiUrl = new Uri("http://localhost:5001");
return new HttpClient() {BaseAddress = apiUrl};
});
builder.Services.AddSingleton<PageHistoryState>();
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();