TheFakeHamma / random-quote-generator

Side project for fun
MIT License
0 stars 0 forks source link

Update JavaScript to Fetch from API #5

Open TheFakeHamma opened 2 months ago

TheFakeHamma commented 2 months ago

Description:
Update the script.js file to fetch quotes from the backend API instead of using mockup data.

Steps:

  1. Remove the mockQuotes array and the getMockQuote function.
  2. Add an async function getQuote to fetch a quote from http://localhost:3000/quote.
  3. Update the #quote element with the fetched quote.
  4. Add an event listener to the #new-quote button to call getQuote.
  5. Call getQuote when the page loads to display an initial quote.