From 2e8e7bad8f7cf0c5c333ac4bf95381defbdf4ae0 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Mon, 7 Mar 2022 19:56:52 +0100 Subject: Dodat Cors. --- backend/api/api/Program.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/api/api/Program.cs b/backend/api/api/Program.cs index 478b7052..84514972 100644 --- a/backend/api/api/Program.cs +++ b/backend/api/api/Program.cs @@ -1,11 +1,22 @@ var builder = WebApplication.CreateBuilder(args); -// Add services to the container. +//Add Cors +builder.Services.AddCors(); + +// Add services to the container builder.Services.AddControllers(); var app = builder.Build(); + +//Add Cors +app.UseCors( + x=>x.AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader() + ); + // Configure the HTTP request pipeline. app.UseAuthorization(); -- cgit v1.2.3