Created
April 14, 2020 15:35
-
-
Save rubenRP/c806c525683caa5535309bd983a344d9 to your computer and use it in GitHub Desktop.
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
const axios = require("axios") | |
const get = endpoint => axios.get(`https://corona.lmao.ninja${endpoint}`) | |
export async function getAllCountriesInfo() { | |
try { | |
let res = await get("/countries?sort=cases") | |
return res.data | |
} catch (error) { | |
console.log(error) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment