Maybe cors? I dont know
This commit is contained in:
@ -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");
|
string connectionString = Environment.GetEnvironmentVariable("DATABASE_CONNECTION_STRING");
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(connectionString))
|
if (string.IsNullOrEmpty(connectionString))
|
||||||
@ -146,8 +156,7 @@ namespace IO.Swagger
|
|||||||
context.Database.Migrate();
|
context.Database.Migrate();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
//TODO: Uncomment this if you need wwwroot folder
|
app.UseCors();
|
||||||
// app.UseStaticFiles();
|
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user