Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 796 Bytes

04 Dad Joke API.md

File metadata and controls

27 lines (16 loc) · 796 Bytes

Dad Joke API

Use the Dad Joke API to get a dad joke and display it to the user.

Part 1

Use fetch or axios to send an HTTP request to https://icanhazdadjoke.com/ with the accept header as application/json. This will return a dad joke in JSON format. You can then use the .json() method on the response to get a javascript object. Get the joke out of the object and show it to the user.

fetch("https://icanhazdadjoke.com/", {
  headers: {
    accept: "application/json"
  }
}).then(response => response.json())
.then(data => console.log(data))

Part 2

Add the ability to "search" for jokes using another endpoint.

Part 3

Add some styling! Flex your css skills.