Last active
July 2, 2020 09:29
-
-
Save rezaindrag/ffe74380a19ed82432e612384e76615e 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"); | |
async function fetchUsers() { | |
const { data } = await axios.get("https://api.github.com/users"); | |
return data; | |
} | |
async function fetchEmployees() { | |
const { data: { data } } = | |
await axios.get("http://dummy.restapiexample.com/api/v1/employees"); | |
return data; | |
} | |
module.exports = { | |
fetchUsers, | |
fetchEmployees, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment