SES-77 #12

Merged
s426135 merged 3 commits from SES-77 into master 2020-12-05 21:32:05 +01:00
2 changed files with 21 additions and 1 deletions
Showing only changes of commit 561b688519 - Show all commits

View File

@ -0,0 +1,12 @@
using Microsoft.AspNetCore.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SessionCompanion.Hubs
{
public class SessionHub : Hub
{
}
}

View File

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http.Connections;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.SpaServices.AngularCli;
using Microsoft.EntityFrameworkCore;
@ -8,6 +9,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SessionCompanion.Configurations;
using SessionCompanion.Database;
using SessionCompanion.Hubs;
namespace SessionCompanion
{
@ -29,7 +31,7 @@ namespace SessionCompanion
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddRepositories();
services.AddSignalR();
// In production, the Angular files will be served from this directory
services.AddSpaStaticFiles(configuration =>
{
@ -70,6 +72,12 @@ namespace SessionCompanion
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
endpoints.MapHub<SessionHub>("/sessionhub", options =>
{
options.Transports =
HttpTransportType.WebSockets |
HttpTransportType.LongPolling;
});
});
app.UseSpa(spa =>