Last active
September 12, 2017 20:38
-
-
Save danilat/4ca5b6e92d75d97dba603ae7251ecd11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HttpClient { | |
get(url) { | |
return new Promise((resolve, reject) => { | |
const requests = require('superagent'); | |
requests.get(url).end((err, response) => { | |
if (err) { | |
reject(err); | |
} | |
else { | |
resolve(response); | |
} | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment