Reputation: 61
I'm using
AspNetCore2.2 WebAppplication Angular CLI: 8.3.3 Node: 10.16.0 OS: win32 x64 Angular: 6.1.10
services.AddSignalR();
app.UseSignalR(config => {
config.MapHub<NotificationHub>("/notify");
});
this.hubConnection.start().then(c => {
console.log('connected');
});
Upvotes: 1
Views: 136
Reputation: 20082
Check your code to see is there any code like below is missing
import * as signalR from "@aspnet/signalr";
const connection = new signalR.HubConnectionBuilder()
.withUrl("/notify")
.build();
connection.start().catch(err => document.write(err));
Update: Change the order of your code like this
app.UseSignalR(routes =>
{
routes.MapHub<CmsCoreHub>("/cmscore");
});
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
Upvotes: 2