This article provides a solution to handle the Cross-Origin Resource Sharing (CORS) error that occurs when calling a backend API from a frontend application due to requests originating from different domains.
When calling a backend API from a frontend application, a CORS error is common if the frontend app and the backend API are hosted on different domains or origins. Browsers implement this policy for security purposes, disallowing such cross-origin requests unless the server permits them.
To resolve this, you can use the following URL structure for your API calls, which should bypass the CORS issue if configured correctly:
https://{userTenant}-{AppName}-{HostTenant}.eu1.mindsphere.io/api/{API_AppName}/v1/{Endpoints}
This URL pattern includes: