Skip to content

Instantly share code, notes, and snippets.

@alexlatam
Created August 28, 2022 14:44
Show Gist options
  • Save alexlatam/d982ad14f642a9862b222680241e1b04 to your computer and use it in GitHub Desktop.
Save alexlatam/d982ad14f642a9862b222680241e1b04 to your computer and use it in GitHub Desktop.
Script para consultar con JavaScript nativo a una api, usando async await
// Hago el llamado al endpoint, y obtengo al respuesta
const response = await fetch(API_URL);
// Paso la informacion de string, a formato JSON
const data = response.json();
// Ahora con la data que retorna el endopoint, puedo procesarlo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment