Optionally add a beoordeling while adding a verspakket

This commit is contained in:
moarten
2026-04-24 21:09:45 +02:00
parent 3a1071dadc
commit 5e1445d532
8 changed files with 136 additions and 15 deletions
+18
View File
@@ -14,6 +14,22 @@ namespace Lutra.API
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowLocalDevelopment", policy =>
policy.SetIsOriginAllowed(origin =>
{
if (!Uri.TryCreate(origin, UriKind.Absolute, out var uri))
{
return false;
}
return uri.Host is "localhost" or "127.0.0.1" or "[::1]";
})
.AllowAnyHeader()
.AllowAnyMethod());
});
builder.Services.AddCortexMediator(
handlerAssemblyMarkerTypes: [typeof(Program), typeof(GetVerspakketten)],
options => options.AddDefaultBehaviors()
@@ -37,6 +53,8 @@ namespace Lutra.API
app.UseHttpsRedirection();
app.UseCors("AllowLocalDevelopment");
app.UseAuthorization();