using Diligent.WebAPI.Host.Hubs;
using Serilog;
using Serilog.Formatting.Json;

var builder = WebApplication.CreateBuilder(args);

builder.ConfigureData(builder.Configuration);
var collection = builder.Services;
Diligent.WebAPI.Host.Extensions.ApiConfiguration.ConfigureServices(collection);
builder.ConfigureValidationMiddleware();
var app = builder.Build();

app.UseCors("ClientPermission");

app.MapControllers();
app.UseAuthentication();
app.UseAuthorization();
app.SetupData();

app.MapHub<ChatHub>("/chatHub");
app.MapHub<ConnectionHub>("/statusHub");

app.Run();