/
Apalchev
/
SimpleLayer
Обзор
Документация
Войти
/
Apalchev
/
SimpleLayer
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ASPServerSignalR/Program.cs
33 строки
902 B
milenium856
Fix some Bugs;
18 авг 2022, 16:00
18 авг 2022, 16:00
98b1ba2
Код
Авторство
О чём код?
using ASPServerSignalR; using ASPServerSignalR.DataStorage; using ASPServerSignalR.Hubs; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.AddSingleton<IMessageStorage, MessageStorage>(); builder.Services.AddSingleton<IMatchStorage, MatchStorage>(); builder.Services.AddSignalR(hubConfig => { hubConfig.EnableDetailedErrors = true; }); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); app.MapHub<ChatHub>("/ChatHub"); app.MapHub<LobbyHub>("/LobbyHub"); app.UseAuthorization(); app.MapControllers(); app.Run();