Files
TaskHybrid/Template.Web/Program.cs

29 lines
1023 B
C#

using IntegryApiClient.Blazor;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using Template.Shared.Components;
using Template.Shared.Interfaces;
using Template.Web.Services;
#if DEBUG
const string BaseRestServicesEndpoint = "https://devservices.studioml.it/ems-api/";
//const string BaseRestServicesEndpoint = "http://192.168.2.23:8080/ems-api/";
#else
const string BaseRestServicesEndpoint = "https://services.studioml.it/ems-api/";
#endif
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddMudServices();
builder.Services.AddAuthorizationCore();
builder.Services.UseIntegry(BaseRestServicesEndpoint);
builder.Services.AddScoped<IFormFactor, FormFactor>();
builder.RootComponents.Add<Routes>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
await builder.Build().RunAsync();