pull/434/merge
DaiVuong 3 weeks ago committed by GitHub
commit ba46dc2a0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,2 +1,10 @@
console.log(countries) import fetch from "node-fetch";
alert('Open the console and check if the countries has been loaded')
const url = 'https://restcountries.com/v2/all' // countries api
fetch(url)
.then(response => response.json()) // accessing the API data as JSON
.then(data => {
// getting the data
console.log(data)
})
.catch(error => console.error(error)) // handling error if something wrong happens
Loading…
Cancel
Save