Skip to content

Commit

Permalink
Update api.js
Browse files Browse the repository at this point in the history
  • Loading branch information
joosudev authored Mar 20, 2024
1 parent d9e400a commit 5eaa28e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const getImagen = async() =>{
const apiKey ='ba70zQMX6yJYDryvhUe3jzWNPNGYrY2Y';
const apiKey ='5duXGZopEkc8xiIiQP21p0mNOyNnYeZX';
const resp = await fetch(`https://api.giphy.com/v1/gifs/random?api_key=${apiKey}`);
const {data} = await resp.json(); // es necesario siempre destrcuturar la data
const {url} = data.images.original // data.data.images.original codigo aternario si no se destructura la data
Expand All @@ -8,4 +8,4 @@ const getImagen = async() =>{
document.body.append(img)
}

getImagen()
getImagen()

0 comments on commit 5eaa28e

Please sign in to comment.