Created
January 23, 2021 18:26
-
-
Save bbachi/76b1b469dbebac0a3a8e6746bf85e550 to your computer and use it in GitHub Desktop.
Asynchronous
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
var rp = require('request-promise'); | |
async function fetchData() { | |
const data = await rp('http://localhost:3070/users'); | |
console.log(JSON.parse(data)); | |
} | |
fetchData().catch(err => console.log(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment