Skip to content

Commit

Permalink
fix core with export default and https in the api call
Browse files Browse the repository at this point in the history
  • Loading branch information
teseo committed May 12, 2017
1 parent 47db4a1 commit 4a0ca40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/core.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export default function get(url){
function get(url){
return fetch(url)
.then((response) => response.json());
}

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)
Expand Down

0 comments on commit 4a0ca40

Please sign in to comment.