VATSIM events API

Hello,

I’m trying to get the VATSIM events API to work on my site as discussed in this older forum thread:

However, I’m having issues connecting using the javascript below. Does anyone have any pointers?

const runVatsimEventApi = function(){
  var vatsimApiUrl = "https://my.vatsim.net/api/v1/events/all"
  fetch(vatsimApiUrl, {mode: 'no-cors'})
  .then((response) => {
    return response.json()
  })
  .then( function(data){
    console.log(data)
  })
}
runVatsimEventApi()

It might help if you describe what issues you are actually having? Any error messages or something like that?