Created
June 11, 2020 05:06
-
-
Save Dromediansk/3bb0f397df437f0ba581c702e771577b to your computer and use it in GitHub Desktop.
fetch data service
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
const getAllCountries = async () => { | |
try { | |
const response = await fetch(`https://restcountries.eu/rest/v2/all`); | |
const responseCountries = await response.json(); | |
return responseCountries; | |
} catch (err) { | |
console.log(err); | |
} | |
}; | |
export const countries = { | |
getAllCountries, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment