In progress
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user