diff --git a/Webshop.Api/Program.cs b/Webshop.Api/Program.cs index ade98bb..72b07bd 100644 --- a/Webshop.Api/Program.cs +++ b/Webshop.Api/Program.cs @@ -32,8 +32,20 @@ var options = new WebApplicationOptions // Diese Zeile setzt den WebRootPath explizit auf den wwwroot-Ordner. WebRootPath = "wwwroot" }; + var builder = WebApplication.CreateBuilder(options); +builder.Services.AddCors(options => +{ + options.AddPolicy("AllowNuxtApp", + policy => + { + policy.WithOrigins("http://localhost:3000") + .AllowAnyHeader() + .AllowAnyMethod(); + }); +}); + // --- 1. Dependency Injection Konfiguration --- // Datenbank-Kontext mit Split-Query-Verhalten für Performance-Optimierung