diff --git a/src/IO.Swagger/Startup.cs b/src/IO.Swagger/Startup.cs index f4f62fc..3fd835e 100644 --- a/src/IO.Swagger/Startup.cs +++ b/src/IO.Swagger/Startup.cs @@ -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();