Skip to content

Commit 93bfbe0

Browse files
committed
Added SignalR
1 parent 0281e0f commit 93bfbe0

23 files changed

+368
-348
lines changed

AutoBlockList.Web/appsettings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
"Id": "e5b7dbb3-b278-4527-8b7b-94f09396316c",
1717
"SanitizeTinyMce": true
1818
},
19-
"Hosting": {"Debug": true},
19+
"Hosting": {
20+
"Debug": true
21+
},
2022
"Content": {
21-
"ShowDeprecatedPropertyEditors": true,
23+
"ShowDeprecatedPropertyEditors": true,
2224
"AllowEditInvariantFromNonDefault": true,
2325
"ContentVersionCleanupPolicy": {
2426
"EnableCleanup": true
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
using System.Linq;
3+
using System.Text;
4+
using Umbraco.Extensions;
5+
using AutoBlockList.Hubs;
6+
using System.Threading.Tasks;
7+
using System.Collections.Generic;
8+
using Umbraco.Cms.Core.Composing;
9+
using Microsoft.AspNetCore.Builder;
10+
using Umbraco.Cms.Core.DependencyInjection;
11+
using Microsoft.Extensions.DependencyInjection;
12+
using Umbraco.Cms.Web.Common.ApplicationBuilder;
13+
14+
namespace AutoBlockList.Composers
15+
{
16+
public class AutoBlockListHubComposer : IComposer
17+
{
18+
public void Compose(IUmbracoBuilder builder)
19+
{
20+
builder.Services.AddSingleton<AutoBlockListHubRoutes>();
21+
builder.Services.AddSignalR();
22+
builder.Services.Configure<UmbracoPipelineOptions>(options =>
23+
{
24+
options.AddFilter(new UmbracoPipelineFilter(
25+
"AutoBlockList",
26+
applicationBuilder => { },
27+
applicationBuilder => { },
28+
applicationBuilder =>
29+
{
30+
applicationBuilder.UseEndpoints(e =>
31+
{
32+
var hubRoutes = applicationBuilder.ApplicationServices.GetRequiredService<AutoBlockListHubRoutes>();
33+
hubRoutes.CreateRoutes(e);
34+
});
35+
}
36+
));
37+
});
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)