diff --git a/scripts/films.js b/scripts/films.js index e69de29..e197e91 100644 --- a/scripts/films.js +++ b/scripts/films.js @@ -0,0 +1,27 @@ +const FILMS = document.getElementById('container'); +const API_URL = "https://swapi.dev/api/films"; + + +fetch(API_URL) +.then((reponse) => { + //console.log(reponse); + return reponse.json() +}) +.then(reponseFormat => { + for(let index = 0; index <6; index++){ + //console.log(reponseFormat.results[index]); + const data = reponseFormat.results[index]; + console.log(data); + + FILMS.innerHTML +=` +
${data.title}
+${data.episode_id}
+${data.opening_crawl}
+${data.director}
+${data.producer}
+${data.release_date}
+${data.starships}
+${data.starships}
+