Trouble enabling CORS
I'm building a website whose frontend is in React, and whose backend is in ASP.NET. I am currently trying to test sending a GET request from the frontend to be handled by the backend, but sending the request gives me the error in the picture.
I have tried fixing it using the method outlined here: https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-8.0#cors-with-named-policy-and-middleware
but I still get the same error.
My Program.cs file:
The code I am using to send the request:
I have tried fixing it using the method outlined here: https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-8.0#cors-with-named-policy-and-middleware
but I still get the same error.
My Program.cs file:
The code I am using to send the request:

Learn how CORS as a standard for allowing or rejecting cross-origin requests in an ASP.NET Core app.
