Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
gablon29 committed Aug 18, 2022
1 parent 839a514 commit ce0c5e5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
Empty file added ClubDeActividades/index.html
Empty file.
Empty file added ClubDeActividades/index.js
Empty file.
15 changes: 15 additions & 0 deletions ConsumiendoApisRest/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gatitos aleatorios</title>
</head>
<body>
<h1>Gatitos aleatorios</h1>

<img alt="Foto Gatitos aleatorios">
<script src="main.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions ConsumiendoApisRest/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
console.log('hello world')

const URL = 'https://api.thecatapi.com/v1/images/search';

fetch(URL) //La funsion de fetch nos devuelve una promesa
.then(res => res.json())
.then(data => {
const img = document.querySelector('img');
img.src = data[0].url;

})

0 comments on commit ce0c5e5

Please sign in to comment.