// Startup.cs using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace FreelancerListServer { public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddControllers().AddNewtonsoftJson(); // Für JSON-Serialisierung services.AddSingleton(); services.AddSingleton(); services.AddCors(options => { options.AddPolicy("AllowAll", builder => { builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader(); }); }); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseCors("AllowAll"); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } }