using zero; using zero.Api; using zero.Applications; using zero.Architecture; using zero.Backoffice; using zero.Backoffice.DevServer; using zero.Commerce; using zero.Configuration; using zero.Demo; using zero.Localization; using zero.Routing; using zero.Spaces; using zero.Stores; var builder = WebApplication.CreateBuilder(args); builder.Services.AddRazorPages(); builder.Services.AddTransient(); builder.Services .AddZero(builder.Configuration, cfg => { cfg.Mvc.AddApplicationPart(typeof(CommercePlugin).Assembly); }) .AddApi() .AddBackoffice() .AddCommerce(); builder.Services.Configure(opts => { opts.Enabled = false; }); builder.Services.Configure(opts => { opts.AddSpaceList("team", "Team", "Members of our team", "fth-users", "spaces.team"); opts.AddIntegration("analytics.fathom", "Fathom Analytics", "Connect your website to Fathom and track page views", tags: new() { "analytics" }, imagePath: "/assets/fathom.png"); opts.AddIntegration("analytics.google", "Google Analytics", "Connect your website to google analytics", tags: new() { "analytics" }, imagePath: "/assets/googleanalytics.png"); opts.Configure(x => x.CanUseWithoutFlavors = false); opts.Add("eu_country", "EU country", "A country within the European Union", "fth-globe"); opts.Add("usa_country", "USA", "A country in the United States", "fth-flag"); }); builder.Services.Configure(opts => { opts.Add(); opts.Add(); opts.Add(); }); var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); } app.UseZero().WithEndpoints(x => { //x.MapControllerRoute("default", "api/{controller}/{action=Index}/{id?}"); x.MapControllers(); x.MapRazorPages(); x.MapZeroApi(); x.MapZeroBackoffice(); x.MapZeroRoutes(); }); //app.UseZeroBackoffice(); app.Run();