Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 479 Bytes

readme.md

File metadata and controls

29 lines (20 loc) · 479 Bytes

Consumir API

API

Criar uma api:

  • Iniciar o projeto com: npm init -y
  • Instalar as dependências npm i express nodemon cors axios
  • Criar uma rota para acessar API
  • Servir a API
  • Habilitar o CORS
  • Habilitar o nodemon para reiniciar o server

Frontend

Consumir API

  • Utilizar o fetch para consumir API backend
  • Promise - Async / Await
  • Usar try / catch

Backend

Consumir API

  • Jsonplaceholder
  • Trabalhando com axios
  • axios e fetch
  • usar try / catch