File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Umbraco.Cms.Api.Management/Routing
tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 77using Umbraco . Cms . Core . Configuration . Models ;
88using Umbraco . Cms . Core . Hosting ;
99using Umbraco . Cms . Core . Services ;
10- using Umbraco . Cms . Core . Web . Mvc ;
11- using Umbraco . Cms . Web . Common . Controllers ;
1210using Umbraco . Cms . Web . Common . Routing ;
1311using Umbraco . Extensions ;
1412
@@ -54,8 +52,8 @@ public void CreateRoutes(IEndpointRouteBuilder endpoints)
5452 case RuntimeLevel . Install :
5553 case RuntimeLevel . Upgrade :
5654 case RuntimeLevel . Run :
57-
5855 MapMinimalBackOffice ( endpoints ) ;
56+ endpoints . MapHub < BackofficeHub > ( _umbracoPathSegment + Constants . Web . BackofficeSignalRHub ) ;
5957 break ;
6058 case RuntimeLevel . BootFailed :
6159 case RuntimeLevel . Unknown :
Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . SignalR ;
2+
3+ namespace Umbraco . Cms . Api . Management . Routing ;
4+
5+ public class BackofficeHub : Hub
6+ {
7+ public async Task SendPayload ( object payload ) => await Clients . All . SendAsync ( "payloadReceived" , payload ) ;
8+ }
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ public const string
5656 /// The "base" path to the Management API
5757 /// </summary>
5858 public const string ManagementApiPath = "/management/api/" ;
59+ public const string BackofficeSignalRHub = "/backofficeHub" ;
5960
6061 public static class Routing
6162 {
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public void RuntimeState_All_Routes(RuntimeLevel level)
4545 var endpoints = new TestRouteBuilder ( ) ;
4646 routes . CreateRoutes ( endpoints ) ;
4747
48- Assert . AreEqual ( 1 , endpoints . DataSources . Count ) ;
48+ Assert . AreEqual ( 2 , endpoints . DataSources . Count ) ;
4949 var route = endpoints . DataSources . First ( ) ;
5050 Assert . AreEqual ( 2 , route . Endpoints . Count ) ;
5151
You can’t perform that action at this time.
0 commit comments