Skip to content

Instantly share code, notes, and snippets.

@ledangtuanbk
Created September 20, 2019 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ledangtuanbk/5ddb8ee96030a8d4839dfa1b9daf7f7d to your computer and use it in GitHub Desktop.
Save ledangtuanbk/5ddb8ee96030a8d4839dfa1b9daf7f7d to your computer and use it in GitHub Desktop.
check cors online
1. go to page with http
2. in console run this command to check
fetch('./api/some.json')
.then(
function(response) {
if (response.status !== 200) {
console.log('Looks like there was a problem. Status Code: ' +
response.status);
return;
}
// Examine the text in the response
response.json().then(function(data) {
console.log(data);
});
}
)
.catch(function(err) {
console.log('Fetch Error :-S', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment