OK figured this out. I forgot to put “return” in front of “fetch”:
return fetch(url, {method: 'get'})
Also, other tips that may be useful for somebody tryuing to set up something like this:
• If your wix website is SSL-enabled, you will not be able to fetch from http, only from https
• If the remote server has https but is using a self signed certificate, you will also get an error
• You also need to allow CORS on the remote server (e.g. by adding the following line to .htaccess; instead of * you could add actual allowed request source)
Header set Access-Control-Allow-Origin "*"