using CShells.AspNetCore.Configuration; using CShells.AspNetCore.Extensions; using CShells.DependencyInjection; using Elsa.ModularServer.Web; using Elsa.ModularServer.Web.Catalog; using Elsa.ShellFeatures; using Elsa.Workflows.Api.ShellFeatures; using Elsa.Workflows.Management.ShellFeatures; using Elsa.Workflows.Runtime.Distributed.ShellFeatures; using Elsa.Workflows.Runtime.ShellFeatures; using Elsa.Workflows.ShellFeatures; using Nuplane; using Nuplane.Loading.Hosting.Builder; using Nuplane.Sources.Directory.Configuration; var builder = WebApplication.CreateBuilder(args); var services = builder.Services; var configuration = builder.Configuration; var nuplaneConfiguration = configuration.GetSection("Nuplane"); services.AddNuplane(nuplaneConfiguration, nuplane => { nuplane.AddDirectoryFeedsFromConfiguration(nuplaneConfiguration); nuplane.AutoloadPackages(nuplaneConfiguration.GetSection("Loading")); nuplane.OnPackagesChanged(); }); services.AddSingleton(); builder.AddShells(shells => shells .WithHostAssemblies() .WithAssemblyProvider() .WithConfigurationProvider(configuration) .WithWebRouting(options => options.EnablePathRouting = true) .WithAuthenticationAndAuthorization() .ConfigureAllShells(shell => { shell.WithFeatures( typeof(ElsaFeature), typeof(WorkflowManagementFeature), typeof(WorkflowRuntimeFeature), typeof(WorkflowsFeature), typeof(DistributedRuntimeFeature), typeof(WorkflowsApiFeature)); })); services.AddSingleton(); services.AddHealthChecks(); services.AddAuthentication(); services.AddAuthorization(); var app = builder.Build(); app.MapHealthChecks("/"); app.MapShells(); app.UseAuthentication(); app.UseAuthorization(); app.MapSampleCatalog(); app.Run();