Amongst the reasons I've heard that "Nexus suxxors!" is that people can't poll the Lusternia API in it, due to CORS, to do things like pull someone's faction. So here's a trivially simple way to do the impossible.
fetch('https://cors-anywhere.herokuapp.com/https://api.lusternia.com/characters/lendren.json')
.then((response) => {
return response.json();
})
.then(data => {
display_notice(data.fullname + ' is of ' + data.faction, 'lightgreen');
})
.catch(error => {
display_notice('error '+ error, 'red');
});
By using the reliable cors-anywhere proxy you can easily pull the JSON through CORS by simply adding a prefix to the fetch URL, then parse and use it as normal. No significant performance impact involved. I've been using this proxy for about two years without any outages or problems on an unrelated project, but if it ever fails, it'd be simple to switch one of the dozen or so others that are out there.
Hope this is helpful for folks.
Comments
(And good thing too. CORS-Anywhere closed down years ago.)