brunopulis
6/4/2017 - 11:52 PM

fetchAPI

const URL = "http://swapi.co/api/people/1" // Retorna Luke Skywalker
fetch(URL)
  .then(function(res){
     res.json().then(function(data){
     console.log(data);
  });
})
.catch(function(err){
   console.error('Não foi possível achar a informação', err);
});