diff --git a/utils/core.js b/utils/core.js index 8c58378..835da38 100644 --- a/utils/core.js +++ b/utils/core.js @@ -1,4 +1,4 @@ -export default function get(url){ +function get(url){ return fetch(url) .then((response) => response.json()); } @@ -6,7 +6,7 @@ export default function get(url){ export default function searchFor(query, offset){ const apiKey = 'api-key'; const requestUrl = ( - `http://content.guardianapis.com/search?show-elements=all&show-blocks=body&show-fields=lastModified,byline,headline,trailText,thumbnail,body&page-size=20&page=${ offset }&q=${ query }&type=article&api-key=${ apiKey }&order-by=newest` + `https://content.guardianapis.com/search?show-elements=all&show-blocks=body&show-fields=lastModified,byline,headline,trailText,thumbnail,body&page-size=20&page=${ offset }&q=${ query }&type=article&api-key=${ apiKey }&order-by=newest` ); return get(requestUrl)