Added node-fetch

This commit adds a node-fetch library to dependencies and adds
a simple method to the Test class which calls it with provided
arguments.

Change-Id: I159d93b37388e3c6884f81a8e6026a514351b71d
This commit is contained in:
Vitaly Kramskikh
2016-07-14 19:53:38 +03:00
parent e8d39a4747
commit fd53f563e2
2 changed files with 9 additions and 2 deletions

View File

@@ -25,7 +25,8 @@
"homepage": "http://www.openstack.org/",
"dependencies": {
"babel-polyfill": "^6.9.1",
"loglevel": "^1.4.1"
"loglevel": "^1.4.1",
"node-fetch": "^1.5.3"
},
"devDependencies": {
"babel-cli": "^6.10.1",

View File

@@ -1,9 +1,15 @@
import 'babel-polyfill';
import fetch from 'node-fetch';
import log from 'loglevel';
log.setLevel('INFO');
export default class Test {
constructor() {
getUrl(url) {
return fetch(url)
.then((response) => {
log.info(response.status);
return response;
});
}
}