Greetings,
me and my team are trying to access our WIX database through an app we are building right now. We just want to test if we can reach the database through a simple Postman GET-Request so we can build further on that. The code itself works on WIX; we are getting the results of the database if we run the code within the platform.
But we cant reach it with Postman, so our first guess is that we are making a mistake with the URL.
Here is the code from our backend in WIX:
import { serverError , ok } from ‘wix-http-functions’ ;
import wixData from ‘wix-data’ ;
export function get_regions () {
let options = {
“headers” : {
“Content-Type” : “application/json” ,
“Access-Control-Allow-Origin” : “*”
}
};
return wixData . query ( “Regions” )
. find ()
. then (( results ) => {
options . body = {
“items” : results . items
};
return ok ( options );
})
// something went wrong
. catch (( error ) => {
options . body = {
“error” : error
};
return serverError ( options );
});
}
That works.
The URL to call WIX:
https://acteevent.wixsite.com/acteevent/_functions/<get_regions>
This is what we currently get. A 404 error message:
Any idea what the problem could be?
EDIT : we have several people with access to the website. Does the username in the URL for the request has to be a specific one?
Best regards,
Dawda