From ff6be4966f8ce3d0ff3a74f30b634c94c022e163 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Mon, 11 Dec 2023 09:23:19 +1000 Subject: [PATCH] feat(api): CORS settings --- PARR.API/Program.cs | 4 ++++ PARR.API/appsettings.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PARR.API/Program.cs b/PARR.API/Program.cs index 3f13c1ec..81ea1bec 100644 --- a/PARR.API/Program.cs +++ b/PARR.API/Program.cs @@ -56,6 +56,8 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); builder.Services.InstallSwaggerService(builder.Configuration); +builder.Services.InstallCorsServices(); + var app = builder.Build(); @@ -70,4 +72,6 @@ app.UseAuthorization(); app.MapControllers(); +app.InstallCors(builder); + app.Run(); diff --git a/PARR.API/appsettings.json b/PARR.API/appsettings.json index c507e05c..25bc4a0c 100644 --- a/PARR.API/appsettings.json +++ b/PARR.API/appsettings.json @@ -29,7 +29,7 @@ }, "AllowedHosts": "*", "CorsSettings": { - "AllowedHosts": "*" + "AllowedHosts": "http://localhost:4200; http://10.99.253.221:8083" }, "StorageSettings": { "StoragePath": "Data",