diff --git a/server.js b/server.js index a5896be..3be036d 100644 --- a/server.js +++ b/server.js @@ -1,9 +1,13 @@ "use strict"; var realFetch = require('node-fetch'); -module.exports = global.fetch = function(url, options) { +module.exports = function(url, options) { if (/^\/\//.test(url)) { url = 'https:' + url; } return realFetch.call(this, url, options); }; + +if (!global.fetch) { + global.fetch = module.exports; +}