Added Imagesharp to the website stuff
This commit is contained in:
@@ -5,14 +5,14 @@ namespace Umbraco.Web.BackOffice.AspNetCore
|
||||
{
|
||||
public static class UmbracoBackOfficeApplicationBuilderExtensions
|
||||
{
|
||||
public static IApplicationBuilder UseUmbracoBackOffice(this IApplicationBuilder builder)
|
||||
public static IApplicationBuilder UseUmbracoBackOffice(this IApplicationBuilder app)
|
||||
{
|
||||
if (builder == null)
|
||||
if (app == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(builder));
|
||||
throw new ArgumentNullException(nameof(app));
|
||||
}
|
||||
|
||||
return builder.UseMiddleware<UmbracoBackOfficeMiddleware>();
|
||||
return app;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Umbraco.Web.BackOffice.AspNetCore
|
||||
{
|
||||
public class UmbracoBackOfficeMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
public UmbracoBackOfficeMiddleware(RequestDelegate next)
|
||||
{
|
||||
_next = next;
|
||||
}
|
||||
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
|
||||
// Call the next delegate/middleware in the pipeline
|
||||
await _next(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,9 @@ namespace Umbraco.Web.UI.BackOffice
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
CreateHostBuilder(args)
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
|
||||
@@ -10,4 +10,8 @@
|
||||
<ProjectReference Include="..\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\Media" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
BIN
src/Umbraco.Web.UI.NetCore/wwwroot/favicon.ico
Normal file
BIN
src/Umbraco.Web.UI.NetCore/wwwroot/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -1,18 +1,24 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using SixLabors.ImageSharp.Web.DependencyInjection;
|
||||
|
||||
namespace Umbraco.Web.Website.AspNetCore
|
||||
{
|
||||
public static class UmbracoBackOfficeApplicationBuilderExtensions
|
||||
{
|
||||
public static IApplicationBuilder UseUmbracoWebsite(this IApplicationBuilder builder)
|
||||
public static IApplicationBuilder UseUmbracoWebsite(this IApplicationBuilder app)
|
||||
{
|
||||
if (builder == null)
|
||||
if (app == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(builder));
|
||||
throw new ArgumentNullException(nameof(app));
|
||||
}
|
||||
|
||||
return builder.UseMiddleware<UmbracoWebsiteMiddleware>();
|
||||
|
||||
// Important we handle image manipulations before the static files, otherwise the querystring is just ignored.
|
||||
app.UseImageSharp();
|
||||
app.UseStaticFiles();
|
||||
|
||||
return app;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Umbraco.Web.Website.AspNetCore
|
||||
{
|
||||
public class UmbracoWebsiteMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
public UmbracoWebsiteMiddleware(RequestDelegate next)
|
||||
{
|
||||
_next = next;
|
||||
}
|
||||
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
|
||||
// Call the next delegate/middleware in the pipeline
|
||||
await _next(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SixLabors.ImageSharp.Web.DependencyInjection;
|
||||
|
||||
namespace Umbraco.Web.Website.AspNetCore
|
||||
{
|
||||
@@ -6,6 +7,9 @@ namespace Umbraco.Web.Website.AspNetCore
|
||||
{
|
||||
public static IServiceCollection AddUmbracoWebsite(this IServiceCollection services)
|
||||
{
|
||||
services.AddImageSharp();
|
||||
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,4 +10,8 @@
|
||||
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
|
||||
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.0-beta0009" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user