Merge remote-tracking branch 'origin/v13/dev' into v14/dev
# Conflicts: # build/azure-pipelines.yml # src/Umbraco.Cms.Api.Delivery/Controllers/DeliveryApiControllerBase.cs # src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs # src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs # src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs # src/Umbraco.Web.BackOffice/Controllers/MediaController.cs # tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs # tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs
This commit is contained in:
@@ -1,19 +1,36 @@
|
||||
namespace Umbraco.Cms.Web.UI
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
=> CreateHostBuilder(args)
|
||||
.Build()
|
||||
.Run();
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureUmbracoDefaults()
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStaticWebAssets();
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
builder.CreateUmbracoBuilder()
|
||||
.AddBackOffice()
|
||||
.AddWebsite()
|
||||
.AddDeliveryApi()
|
||||
.AddComposers()
|
||||
.Build();
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
|
||||
await app.BootUmbracoAsync();
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
#if (UseHttpsRedirect)
|
||||
app.UseHttpsRedirection();
|
||||
#endif
|
||||
|
||||
app.UseUmbraco()
|
||||
.WithMiddleware(u =>
|
||||
{
|
||||
u.UseBackOffice();
|
||||
u.UseWebsite();
|
||||
})
|
||||
.WithEndpoints(u =>
|
||||
{
|
||||
u.UseInstallerEndpoints();
|
||||
u.UseBackOfficeEndpoints();
|
||||
u.UseWebsiteEndpoints();
|
||||
});
|
||||
|
||||
await app.RunAsync();
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
namespace Umbraco.Cms.Web.UI
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
private readonly IWebHostEnvironment _env;
|
||||
private readonly IConfiguration _config;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Startup" /> class.
|
||||
/// </summary>
|
||||
/// <param name="webHostEnvironment">The web hosting environment.</param>
|
||||
/// <param name="config">The configuration.</param>
|
||||
/// <remarks>
|
||||
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337.
|
||||
/// </remarks>
|
||||
public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
|
||||
{
|
||||
_env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment));
|
||||
_config = config ?? throw new ArgumentNullException(nameof(config));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the services.
|
||||
/// </summary>
|
||||
/// <param name="services">The services.</param>
|
||||
/// <remarks>
|
||||
/// This method gets called by the runtime. Use this method to add services to the container.
|
||||
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940.
|
||||
/// </remarks>
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddUmbraco(_env, _config)
|
||||
.AddBackOffice()
|
||||
.AddWebsite()
|
||||
.AddDeliveryApi()
|
||||
.AddComposers()
|
||||
.Build();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the application.
|
||||
/// </summary>
|
||||
/// <param name="app">The application builder.</param>
|
||||
/// <param name="env">The web hosting environment.</param>
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
#if (UseHttpsRedirect)
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
#endif
|
||||
|
||||
app.UseUmbraco()
|
||||
.WithMiddleware(u =>
|
||||
{
|
||||
u.UseBackOffice();
|
||||
u.UseWebsite();
|
||||
})
|
||||
.WithEndpoints(u =>
|
||||
{
|
||||
u.UseInstallerEndpoints();
|
||||
u.UseBackOfficeEndpoints();
|
||||
u.UseWebsiteEndpoints();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@using Umbraco.Extensions
|
||||
@using Umbraco.Cms.Web.UI
|
||||
@using Umbraco.Cms.Web.Common.PublishedModels
|
||||
@using Umbraco.Cms.Web.Common.Views
|
||||
@using Umbraco.Cms.Core.Models.PublishedContent
|
||||
|
||||
Reference in New Issue
Block a user