I am using JSFiddle to make some tests with the fetch API, but I am getting CORS origin block everytime.
Is there a way to bypass it? The server I am fetching is localhost, should I do something to accept requests by JSFiddle or is there an easier way to do it witout touching my server configuration?
Here is an example:
async function getText(url) {
try{
var response = await fetch(url);
var txt = await response.text();
return txt;
}
catch(e){
console.log('there was an error');
console.log(e);
}
}
alert(getText('https://www.vim.org/git.php'));