Fix Access-Control-Allow-Origin Error in React Native + ASP.NET Core Project【15 USD】

Job ID: 33719977

Budget: $10 – $30 USD

Front-end: React Native
Back-end: ASP.NET Core C#
Database: MSSQL 2019

Error message: Access to XMLHttpRequest at <...> from origin <...> has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

There are three ways to enable CORS as described on below page. I chose to use endpoint routing.
https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-6.0#ecors6

Please fix the error and load data from backend.
Related backend and database code are 95% done.

You have to work remotely on my computer via TeamViewer. No other options.
Related categories: C# Programming ASP.NET React Native