Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paulohenriquesn/947d458bf54b2aa5d696fbeef6237494 to your computer and use it in GitHub Desktop.
Save paulohenriquesn/947d458bf54b2aa5d696fbeef6237494 to your computer and use it in GitHub Desktop.
//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