35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Http.Connections;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using QuestShare.Server.Hubs;
|
|
using QuestShare.Server.Managers;
|
|
|
|
namespace QuestShare.Server
|
|
{
|
|
public class Startup
|
|
{
|
|
public void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddSignalR(options =>
|
|
{
|
|
options.EnableDetailedErrors = true;
|
|
}).AddJsonProtocol(options =>
|
|
{
|
|
options.PayloadSerializerOptions.PropertyNamingPolicy = null;
|
|
});
|
|
}
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
{
|
|
app.UseRouting();
|
|
app.UseWebSockets();
|
|
app.UseDeveloperExceptionPage();
|
|
app.UseEndpoints(endpoints =>
|
|
{
|
|
endpoints.MapHub<ShareHub>("/Hub", options =>
|
|
{
|
|
options.Transports = HttpTransportType.WebSockets | HttpTransportType.ServerSentEvents | HttpTransportType.LongPolling;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|