Can't fetch function, CORS

Iā€™m trying to run a contract function, making a fetch to the API endpoint returns

Access to fetch at '<contrac>/function?chain=bsc%20testnet&function_name=getInfo' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Changing cors mode does nothing.

I also tried with const tx = async () => await Moralis.executeFunction(options); but this returns

POST <url>net::ERR_FAILED 500

executeFunction should only connect to metamask

what it is working in that application?