
Bryan Estiven Silva Mercado
Preguntame da el siguiente error
{“error”:10,“message”:“Invalid API key - You must be granted a valid key by last.fm”}
y la variable api key me sale como indeninida.
Este es mi codigo , alguna idea del error.
import config from './config' const { api_key } = config const url = `http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=ecuador&api_key=${api_key}&format=json` export default function getArtist() { return fetch(url) .then(res => res.json()) .then(json => json.topartists.artist) }

Bryan Estiven Silva Mercado
cambie a esta sintaxis y todo funciono
const api_key = config.apiKey