Last updated
Last updated
Umbraco ships with signalR installed. This article shows how to add your own hub(s) to the existing setup.
We are going to go for the most basic implementation possible, a status ping. So first create a new interface with the following code:
And then the actual hub:
The next step in the setup is registering our custom route:
When setting up SignalR routes, add the route to ReservedPaths
in the appsettings.json
file like:
And lastly we can test the setup with some JavaScript in our view:
When you insert this in a view, you should see a signalR connection established
console message followed by Pong
.
You need to provide the default reserved paths, else you'll run into an issue as mentioned on .
Umbraco ships with signalR installed, find out how to add your own hub(s) to the existing setup