I was wondering if anyone could run Netlify Functions from webflow site.
Here is a sample request that I try to trigger from webflow website:
fetch("https://brilliant-basbousa-e67359.netlify.app/api/test", {
method: "POST"
})
.then(response => response.text())
.then(data => {
// handle the response data
console.log(data);
})
.catch(error => {
console.warn("Something went wrong.", error);
});
It can be tested with any webflow site through console.
As a result I receive the below: Access to fetch at 'https://brilliant-basbousa-e67359.netlify.app/api/test' from origin 'https://**********.webflow.io' 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.
Headers are already configured on Netlify end as per below, but the issue persists:
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, OPTION",
"Content-Type": "application/json"
Was anyone able to resolve this issue with Netlify?