Following the example for the real time database:
My code is as follows
const API_HOST = 'https://api.backendless.com';
const APP_ID = '***';
const API_KEY = '***';
Backendless.serverURL = API_HOST;
Backendless.initApp(APP_ID, API_KEY);
const MoviesTable = Backendless.Data.of('Movies');
MoviesTable.find(Backendless.DataQueryBuilder.create().setPageSize(100).setSortBy('created')).then(result => { console.log(result); });
I am running the example on localhost.
I receive the following error log.
GET: https://api.backendless.com/***/***/data/Movies?pageSize=100&sortBy=created
[HTTP/1.1 401 Unauthorized 222ms]
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
https://api.backendless.com/***/***/data/Movies?pageSize=100&sortBy=created. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
Uncaught (in promise) Error: Network Error
onerror https://api.backendless.com/sdk/js/latest/backendless.min.js:15
v https://api.backendless.com/sdk/js/latest/backendless.min.js:15
v https://api.backendless.com/sdk/js/latest/backendless.min.js:15
send https://api.backendless.com/sdk/js/latest/backendless.min.js:15
value https://api.backendless.com/sdk/js/latest/backendless.min.js:15
value https://api.backendless.com/sdk/js/latest/backendless.min.js:15
e https://api.backendless.com/sdk/js/latest/backendless.min.js:15
u https://api.backendless.com/sdk/js/latest/backendless.min.js:15
_invoke https://api.backendless.com/sdk/js/latest/backendless.min.js:15
t https://api.backendless.com/sdk/js/latest/backendless.min.js:15
n https://api.backendless.com/sdk/js/latest/backendless.min.js:15
a https://api.backendless.com/sdk/js/latest/backendless.min.js:15
exports https://api.backendless.com/sdk/js/latest/backendless.min.js:15
exports https://api.backendless.com/sdk/js/latest/backendless.min.js:15
value https://api.backendless.com/sdk/js/latest/backendless.min.js:15
<anonymous> http://localhost:8080/script.js:19
I have set the permissions for the table to enable GET requests for the JS API. I am using the JS API key. I have found no other similar forum posts.