Created
October 18, 2019 23:35
-
-
Save paulohenriquesn/947d458bf54b2aa5d696fbeef6237494 to your computer and use it in GitHub Desktop.
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
//arquivo api.js | |
import axios from 'axios'; | |
const api = axios.create({ | |
baseURL: "https://min-api.cryptocompare.com" | |
}); | |
export default api; | |
//arquivo de request; | |
import api from './api.js' | |
async function getValue() | |
{ | |
const response = await api.get('/data/price?fsym=BTC&tsyms=BRL'); | |
console.log(response.data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment