Element API CORS issue I'm running into this effectively https://github.com/pixelandtonic/ElementAPI/issues/4 and I'm not quite sure how I'd integrate this change with https://gist.github.com/stevieg83/85dd058dc77a3b46764165975b17bb76 adding it as the first part of my function errors out for me 

syntax error, unexpected '=&gt;' (T_DOUBLE_ARROW)

What's missing?
100% untested, but try this:

return [
    'endpoints' =&gt; [
        'api/jobs.json' =&gt; function() {
            HeaderHelper::setHeader([
                'Access-Control-Allow-Origin' =&gt; 'http://example.com'
            ]);

            return [
                'elementType' =&gt; 'Entry',
                'criteria' =&gt; ['section' =&gt; 'jobs'],
                'transformer' =&gt; function(EntryModel $entry) {
                    return [
                        'title' =&gt; $entry-&gt;title,
                        'url' =&gt; $entry-&gt;url,
                        'jsonUrl' =&gt; UrlHelper::getUrl("jobs/{$entry-&gt;id}.json"),
                    ];
                },
            ];
        },
        'api/jobs/&lt;entryId:\d+&gt;.json' =&gt; function($entryId) {
            HeaderHelper::setHeader([
                'Access-Control-Allow-Origin' =&gt; 'http://example.com'
            ]);

            return [
                'elementType' =&gt; 'Entry',
                'criteria' =&gt; ['id' =&gt; $entryId],
                'first' =&gt; true,
                'transformer' =&gt; function(EntryModel $entry) {
                    return [
                        'title' =&gt; $entry-&gt;title,
                        'url' =&gt; $entry-&gt;url,
                        'entryId' =&gt; $entry-&gt;id,
                        'postDate' =&gt; $entry-&gt;postDate,
                    ];
                },
            ];
        },
    ]
];