Created
March 30, 2020 22:51
-
-
Save klogic/c9d1c16616459d6e72de27b958e050b6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const axios = require("axios"); | |
const getPosts = async url => { | |
return new Promise((resolve, reject) => { | |
axios | |
.get(url) | |
.then(result => resolve(result.data)) | |
.catch(error => reject(error)); | |
}); | |
}; | |
module.exports = { getPosts }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment