Files
AMessanger-Server/AMessanger.API/Program.cs
T
2026-08-28 03:54:53 +03:00

34 lines
611 B
C#

using AMessanger.Core.Hubs;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
builder.Services.AddSwaggerGen();
builder.Services.AddSignalR();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.UseSwagger().UseSwaggerUI();
app.MapHub<ChatHub>("/hubs/chat");
app.Run();