JSON Server GET

by Jacob King

JavaScript

fetch('http://localhost:3000/users')
  .then(r => r.json())
  .then(users => console.log(users));

fetch('http://localhost:3000/users/1')
  .then(r => r.json())
  .then(user => console.log(user));