Skip to content

Commit f488d4e

Browse files
author
Robert Jackson
committed
Migrate from got to node-fetch.
1 parent cfb5394 commit f488d4e

File tree

3 files changed

+32
-122
lines changed

3 files changed

+32
-122
lines changed

package-lock.json

Lines changed: 27 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test": "qunit tests/**/*-test.js"
1717
},
1818
"dependencies": {
19-
"got": "^11.5.1"
19+
"node-fetch": "^2.6.0"
2020
},
2121
"devDependencies": {
2222
"eslint": "^7.6.0",

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
'use strict';
2-
const got = require('got');
2+
const fetch = require('node-fetch');
33

44
module.exports = async function (channelType) {
55
let HOST = process.env.EMBER_SOURCE_CHANNEL_URL_HOST || 'https://s3.amazonaws.com';
66
let PATH = 'builds.emberjs.com';
77

8-
const result = await got(`${HOST}/${PATH}/${channelType}.json`, { json: true });
8+
const response = await fetch(`${HOST}/${PATH}/${channelType}.json`);
9+
const result = await response.json();
910

10-
return `${HOST}/${PATH}${result.body.assetPath}`;
11+
return `${HOST}/${PATH}${result.assetPath}`;
1112
};

0 commit comments

Comments
 (0)