Skip to content

Commit

Permalink
Flux - 8 - Implementing Fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jul 5, 2015
1 parent 92a5b98 commit 0d47fe0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgur-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"react-router": "^1.0.0-beta2",
"reactify": "^1.1.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^2.4.0"
"watchify": "^2.4.0",
"whatwg-fetch": "^0.9.0"
},
"devDependencies": {}
}
13 changes: 13 additions & 0 deletions imgur-client/src/utils/api.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var Fetch = require('whatwg-fetch');
var rootUrl = 'https://api.imgur.com/3/';
var apiKey = '430d6820d865788';

module.exports = {
get: function(url) {
return fetch(rootUrl + url, {
headers: {
'Authorization': 'Client-ID ' + apiKey
}
});
}
};

0 comments on commit 0d47fe0

Please sign in to comment.