Prima configurazione e struttura

This commit is contained in:
2026-02-04 17:31:00 +01:00
parent 1a949051ca
commit ecafebae7f
66 changed files with 1153 additions and 645 deletions

View File

@@ -1,43 +1,30 @@
using IntegryApiClient.Blazor;
using Template.Web.Components;
using Template.Shared.Interfaces;
using Template.Web.Services;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using SteUp.Shared.Components;
using SteUp.Shared.Core.Interface;
using SteUp.Shared.Core.Services;
using SteUp.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);
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddMudServices();
builder.Services.AddAuthorizationCore();
// Add services to the container.
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddBlazorBootstrap();
builder.Services.UseIntegry(BaseRestServicesEndpoint);
const string appToken = "4fef1843-793d-499b-a7ed-1edd8cac465c";
builder.Services.UseIntegry(appToken: appToken, useLoginAzienda: true);
builder.Services.AddScoped<IFormFactor, FormFactor>();
var app = builder.Build();
builder.Services.AddScoped<AppAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(provider => provider.GetRequiredService<AppAuthenticationStateProvider>());
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error", createScopeForErrors: true);
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
builder.RootComponents.Add<Routes>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
app.UseHttpsRedirection();
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(Template.Shared._Imports).Assembly);
app.Run();
var host = builder.Build();
await host.RunAsync();