# Pastebin Km4U9INL _get: function(url, eventKey) { var fetchPromise = fetch(this.urlBase + url, { method: 'GET', mode: 'cors', redirect: 'follow' }); fetchPromise.then(function(response) { return response.json() }).then((function(json) { document.body.dispatchEvent(new CustomEvent(eventKey, { detail: json })); }).bind(this)) }, getSwarmPeers: function(e) { this._get('/swarm/peers', 'swarm-peers'); },