Skip to content

Instantly share code, notes, and snippets.

@rezaindrag
Last active July 2, 2020 09:29
Show Gist options
  • Save rezaindrag/ffe74380a19ed82432e612384e76615e to your computer and use it in GitHub Desktop.
Save rezaindrag/ffe74380a19ed82432e612384e76615e to your computer and use it in GitHub Desktop.
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