Error: ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
Access to fetch at 'https://api.attentivemobile.com/v1/subscriptions' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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.`
Code:
async function smsSubscription() {
const subscribe = await fetch('https://api.attentivemobile.com/v1/subscriptions', {
method: 'post',
body: JSON.stringify({
"user": {
"phone": '(502)276-8568',
"email": 'any@any.com'
},
"signUpSourceId": "2323"
}),
headers: {
'Content-Type': 'application/json',
'Authorization': '[hidden]'
}
});