Hi, I'm really a rookie in Corvid but with a lot of experience in Java.
I try to invoke a rest service running on a Tomcat server developed by me in a public website with https. In corvid by wix I have a home page with this code.
import { getJSON } from 'wix-fetch';
....
const url = "https://mydomain/sample-rest/get";
...
console.log(url);
getJSON(url).then(json => console.log(json.label)).catch(err => console.log(err));
but I get always in console: TypeError: Failed to fetch
However that invocation reach and finish normaly in the server side
if I invoke from a java client all its ok and return
{"label":"Hello World","value":1}
REST Service Invoked Successfully..
I tried with other corvid's sample invoking this url https://api.exchangeratesapi.io/latest and it works
Could someone help me?
Thanks in advance!
I would use a try catch statement on the published version and check out the console. Also, check to see if you're getting a 404 or 403 there as it's more reliable/useful than console.log()