1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-15 06:37:54 -05:00

add support for azuresignalr services

This commit is contained in:
Kyle Spearrin
2018-08-22 16:04:27 -04:00
parent 6a2e64f2a0
commit d992125b5f
3 changed files with 22 additions and 5 deletions

View File

@ -54,7 +54,14 @@ namespace Bit.Notifications
});
// SignalR
services.AddSignalR();
if(!string.IsNullOrWhiteSpace(globalSettings.Notifications?.AzureSignalRConnectionString))
{
services.AddSignalR().AddAzureSignalR(globalSettings.Notifications.AzureSignalRConnectionString);
}
else
{
services.AddSignalR();
}
services.AddSingleton<IUserIdProvider, SubjectUserIdProvider>();
// Mvc
@ -103,10 +110,14 @@ namespace Bit.Notifications
app.UseAuthentication();
// Add SignlarR
app.UseSignalR(routes =>
if(!string.IsNullOrWhiteSpace(globalSettings.Notifications?.AzureSignalRConnectionString))
{
routes.MapHub<NotificationsHub>("/hub");
});
app.UseAzureSignalR(routes => routes.MapHub<NotificationsHub>("/hub"));
}
else
{
app.UseSignalR(routes => routes.MapHub<NotificationsHub>("/hub"));
}
// Add MVC to the request pipeline.
app.UseMvc();