Skip to content

Instantly share code, notes, and snippets.

@rogerwelin
Created July 7, 2021 22:49
Show Gist options
  • Save rogerwelin/31b1c05bf6e595154caee47e60c74236 to your computer and use it in GitHub Desktop.
Save rogerwelin/31b1c05bf6e595154caee47e60c74236 to your computer and use it in GitHub Desktop.
const axios = require('axios');
const getapa = async () => {
try {
let response = await axios.get('https://jsonplaceholder.typicode.com/users');
return response
} catch (error) {
throw new Error(error)
}
}
getapa().then((val) => {
console.log(val)
}).catch(e => console.log(e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment