CORS issue both from localhost and deployment on backendless.com

Hey, maybe someone can help me. I’m trying to follow the tutorial for angular+backendless: How to Create a Web App Using Angular and Backendless | Backendless
i’m stuck on CORS issue. When running from localhost, I get

Access to XMLHttpRequest at ‘https://api.backendless.com/XXX/XXXX/data/Person’ from origin ‘http://localhost:4200’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

When tried deploying dist to a zipped file, as described at the end of the tutorial, I again get CORS:

Access to XMLHttpRequest at ‘https://api.backendless.com/XXX/XXX/data/Person’ from origin ‘https://eu-api.backendless.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

When tried enabling CORS plugin in chrome I do not get CORS but an unauthrized response:

GET https://api.backendless.com/XXX/XXX/data/Person 401 (Unauthorized)core.js:5967 ERROR Error: Uncaught (in promise): Error: Unable to identify the application. Make sure application ID and API key are correct
Error: Unable to identify the application. Make sure application ID and API key are correct
at new ResponseError (backendless.js:1105)

(My app ID and key are correct, used JS api key)
On the Domain Control page, domains are set as ‘*’ for all.

Can anyone advise? Not sure what I’m doing wrong

Hello @Olga_Yasovsky

We cannot reproduce the problem. Can you check again if you are facing the problem now?

Regards,
Inna

This error is commonly seen when running front-end locally.
The browser will block because of same-origin-policy,
the http://localhost:4200 and https://api.backendless.com are diff domains.

The common way to fix is to use a proxy locally (configured in the angular.json)