Skip to content

Instantly share code, notes, and snippets.

@FabricioFFC
Created June 4, 2018 01:57
Show Gist options
  • Save FabricioFFC/f4e7a91e4b35a7421a2059312caff595 to your computer and use it in GitHub Desktop.
Save FabricioFFC/f4e7a91e4b35a7421a2059312caff595 to your computer and use it in GitHub Desktop.
const teamsApiUrl = 'http://private-c09d5b-worldcup20181.apiary-mock.com/teams';
async function getAll() {
try {
const response = await fetch(teamsApiUrl);
const responseJson = await response.json();
return responseJson;
} catch (error) {
console.error(error);
}
}
const teamsApi = {
getAll,
};
export default teamsApi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment