using ColaFlow.API.Extensions; using ColaFlow.API.Middleware; using Scalar.AspNetCore; var builder = WebApplication.CreateBuilder(args); // Register ProjectManagement Module builder.Services.AddProjectManagementModule(builder.Configuration); // Add controllers builder.Services.AddControllers(); // Configure OpenAPI/Scalar builder.Services.AddOpenApi(); var app = builder.Build(); // Configure the HTTP request pipeline if (app.Environment.IsDevelopment()) { app.MapOpenApi(); app.MapScalarApiReference(); } // Global exception handler (should be first in pipeline) app.UseMiddleware(); app.UseHttpsRedirection(); app.MapControllers(); app.Run();