Open JakobPaulsson opened 2 years ago
To avoid issues with CORS entirely, the following frontend code should be moved to the backend.:
var url = Uri.parse('http://api.ouraring.com/v1/userinfo?access_token=$token'); var response = await http.get(url, headers: { "Accept": "application/json", "Access-Control-Allow-Origin": "*" });
This can be transformed into equivalent code in javascript:
axios.get('https://api.ouraring.com/v1/userinfo?access_token=${access_token}') .then(res => { console.log(`statusCode: ${res.status}`) console.log(res) }) .catch(error => { console.error(error) })
To avoid issues with CORS entirely, the following frontend code should be moved to the backend.:
This can be transformed into equivalent code in javascript: