Access Element API JSON in another environment First Craft project and off to a great start. I don't think i'll ever touch Wordpress again. :)

I'm using the Element API plugin to build out one of my feeds of entries and hoping to use that on a couple sites as a little widget.

JSON: https://csgoevents.gg/api/events.json

Using jQuery for now: http://codepen.io/eboyer/pen/kXqNXJ

Getting this error: "XMLHttpRequest cannot load . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access."

Historically, i'm more of a designer/html/css developer, so HTTP &amp; API work is new to me. From what I understand this can be avoided if the server could return JSONP? Or if I had any sort of control over nginx configurations? (I'm hosting with Web Faction)

Are there any examples out there of using Element API data on other domains?

Hopefully its something with a quick solve. Thanks in advance, excited to be here!
Brandon answered this in a github issue https://github.com/pixelandtonic/ElementAPI/issues/4

You can do that by setting your endpoint config to an anonymous function:

'my/endpoint/pattern' =&gt; function() {
    HeaderHelper::setHeader([
        'Access-Control-Allow-Origin' =&gt; 'http://example.com'
    ]);

    return [
        // ...
    ];
}