I have built an ML backend and deployed it over google cloud. When I call the backend from a wix front-end form with some data, I get the following error:
export function button1_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
var data = $w( “#textBox1” ).value;
var raw = JSON.stringify({ “data” :data});
var requestOptions = {
method: ‘POST’ ,
body: raw,
redirect: ‘follow’
};
var url = “https://url-for-google-webapp”
fetch(url, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
. catch (error => console.log( ‘error’ , error));
}