Maybe cors? I dont know

This commit is contained in:
2023-08-13 19:39:36 -04:00
parent adfa7d45ef
commit 5983447e20

View File

@ -122,6 +122,16 @@ namespace IO.Swagger
});
});
services.AddCors(opt => {
opt.AddDefaultPolicy(po =>
{
po.AllowAnyHeader()
.WithMethods("GET", "POST")
.WithOrigins("http://localhost:*", "https://localhost:*", "http://*.shrukanslab.xyz", "https://*.shrukanslab.xyz")
.SetIsOriginAllowedToAllowWildcardSubdomains();
});
});
string connectionString = Environment.GetEnvironmentVariable("DATABASE_CONNECTION_STRING");
if (string.IsNullOrEmpty(connectionString))
@ -146,8 +156,7 @@ namespace IO.Swagger
context.Database.Migrate();
app.UseRouting();
//TODO: Uncomment this if you need wwwroot folder
// app.UseStaticFiles();
app.UseCors();
app.UseAuthorization();