In progress
Some checks failed
Code Coverage / Generate Coverage Report (push) Has been cancelled
Tests / Run Tests (9.0.x) (push) Has been cancelled
Tests / Docker Build Test (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled

This commit is contained in:
Yaojia Wang
2025-11-03 11:51:02 +01:00
parent 24fb646739
commit fe8ad1c1f9
101 changed files with 26471 additions and 250 deletions

View File

@@ -1,5 +1,5 @@
using ColaFlow.API.Extensions;
using ColaFlow.API.Middleware;
using ColaFlow.API.Handlers;
using Scalar.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
@@ -10,6 +10,10 @@ builder.Services.AddProjectManagementModule(builder.Configuration);
// Add controllers
builder.Services.AddControllers();
// Configure exception handling (IExceptionHandler - .NET 8+)
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
builder.Services.AddProblemDetails();
// Configure CORS for frontend
builder.Services.AddCors(options =>
{
@@ -34,7 +38,7 @@ if (app.Environment.IsDevelopment())
}
// Global exception handler (should be first in pipeline)
app.UseMiddleware<GlobalExceptionHandlerMiddleware>();
app.UseExceptionHandler();
// Enable CORS
app.UseCors("AllowFrontend");