Created
December 15, 2019 17:35
-
-
Save Dromediansk/73fc083d2461a6f13114a2711b5b924c to your computer and use it in GitHub Desktop.
Call all data of countries
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
| export 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); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment