cors error code code example
Example 1: nock CORS error
fetchNockProject = nock($API)
.defaultReplyHeaders({ 'access-control-allow-origin': '*' })
.get('/projects/1')
.reply('200', project);
Example 2: javascript cors error
$.ajax({
headers: { "Accept": "application/json"},
type: 'GET',
url: 'http://cl.ly/2wr4',
crossDomain: true,
beforeSend: function(xhr){
xhr.withCredentials = true;
},
success: function(data, textStatus, request){
console.log(data);
}
});