diff options
| author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-03-07 19:56:52 +0100 | 
|---|---|---|
| committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-03-07 19:56:52 +0100 | 
| commit | 2e8e7bad8f7cf0c5c333ac4bf95381defbdf4ae0 (patch) | |
| tree | ae1eb7128799cc0b3491250b2eac6a9b95319b08 /backend/api | |
| parent | 7ce6eb09b198e796301dbd7c3e4b23441e2d46ae (diff) | |
Dodat Cors.
Diffstat (limited to 'backend/api')
| -rw-r--r-- | backend/api/api/Program.cs | 13 | 
1 files changed, 12 insertions, 1 deletions
| 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(); | 
