From 1fba3e81f1745ea01fed76f24ef1b5c17c3d8a03 Mon Sep 17 00:00:00 2001 From: Santhosh S <913341@dadeschools.net> Date: Mon, 13 Nov 2023 21:24:16 -0500 Subject: [PATCH] Reverted Surveys CORS changes WithOrigins('*') --- .../DamageAssesment.Api.Surveys/Program.cs | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/DamageAssesmentApi/DamageAssesment.Api.Surveys/Program.cs b/DamageAssesmentApi/DamageAssesment.Api.Surveys/Program.cs index eca1be6..8c774f6 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Surveys/Program.cs +++ b/DamageAssesmentApi/DamageAssesment.Api.Surveys/Program.cs @@ -33,28 +33,13 @@ builder.Services.AddAuthentication(item => }; }); -// CORS setup to allow requests from any origin. -//builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => { -// build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin(); -//})); - - - -//builder.Services.AddCors(options => -//{ -// options.AddPolicy("DamageAppCorsPolicy", builder => -// { -// builder.WithOrigins("*") -// .AllowAnyHeader() -// .WithMethods("POST") // Allowing only the POST method -// .AllowAnyOrigin(); -// }); - -//}); +//CORS setup to allow requests from any origin. builder.Services.AddCors(p => p.AddPolicy("DamageAppCorsPolicy", build => { - build.WithOrigins("http://localhost:3000").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin(); + build.WithOrigins("*").AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin(); })); + + // Add controller services and API Explorer for endpoint discovery. builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle