hi,
after doing all the settings of the Get method, when I access the API link, error 404 Not Found appears. I’ve modified in every way the “header” to accept and it still doesn’t work.
my site has premium domain
https://www.{user_domain}/_functions/
import {ok, notFound, serverError} from 'wix-http-functions';
import wixData from 'wix-data';
export function get_products(request) {
// URL: https :// www.mysite.br/_functions/products/ or
// URL: https :// www.mysite.br/_functions-dev/products/
let options = {
"headers": {
"Content-Type": "application/json"
"Access-Control-Allow-Methods": "GET, DELETE, HEAD, OPTIONS",
"Access-Control-Allow-Origin": "https:// www.mysite.br/",
}
};
return wixData .query("products")
.find()
.then( (results) => {
if(results.items.length > 0) {
options .body = {
"items": results .items
};
return ok(options);
}
});
}
ERROR
tks for help.