Get me and cors
This commit is contained in:
@@ -14,6 +14,18 @@ builder.Services.AddOpenApi();
|
||||
|
||||
builder.Services.AddAips(builder.Configuration);
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("frontend", policy =>
|
||||
{
|
||||
policy
|
||||
.WithOrigins("http://localhost:5173")
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod()
|
||||
.AllowCredentials();
|
||||
});
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
await app.Services.InitializeInfrastructureAsync();
|
||||
@@ -24,6 +36,8 @@ if (app.Environment.IsDevelopment())
|
||||
app.MapOpenApi();
|
||||
}
|
||||
|
||||
app.UseCors("frontend");
|
||||
|
||||
app.UseMiddleware<ExceptionHandlingMiddleware>();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
Reference in New Issue
Block a user