Hello I have application backend is .NET Core and frontend is Angular 2+. I have one page that two people can both chat and see report in charts. I want to connect chart data and chat to backend with signalR. I can connected chat application. But how can I also make connection for chart datas? If there is any idea i will be so happy.
2
votes
You want this on same hub, or two different hubs?
– Kiril1512
I want it in different hubs. Different url . When i call data in hub I don't want to get both messages and chart infos. They should come in different hub and connections
– core_user
Then you just need to your client service connect with the other hub. What is your exactly your problem here?
– Kiril1512
For angular part there is no problem . What about core api part. how can I add second link in startup.cs ?
– core_user
1 Answers
0
votes
to add another hub, you just create the second hub class and add it on the startup like:
public override void Configure(IApplicationBuilder app, HostConfiguration hostConfiguration, ILogger<Startup> logger)
{
base.Configure(app, hostConfiguration, logger);
app.UseWebSockets();
app.UseCors(CorsPolicy);
app.UseSignalR(routes =>
{
routes.MapHub<ChatHub>("/chatHub");
routes.MapHub<DataHub>("/dataHub");
});
}