Created
January 31, 2019 13:32
-
-
Save agneym/a6917e38336cc5f1ece15450c2c9e8b8 to your computer and use it in GitHub Desktop.
API Call from Node from Axios
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 axios = require("axios"); | |
async function getData() { | |
const response = await axios.get("https://cat-fact.herokuapp.com/facts"); | |
console.log(response.data); | |
} | |
getData(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment