Skip to content

HTML,CSS, JavaScript and API advice app from Front-End Mentor.

License

Notifications You must be signed in to change notification settings

matheus-lincon/advice-generator-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Advice generator app solution

This is a solution to the Advice generator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • Generate a random advice by pressing a dice button

Screenshot


Links

My process

Built with

  • Semantic HTML5 markup
  • JavaScript
  • API Consuming
  • Flexbox
  • Position relative & absolute
  • Mobile-first workflow

What I learned

This advice app helped me to understand a little bit about how to consume API.

There are a lot of ways you can do it. In my case, to this project I used Axios CDN, you can see more here Axios.

Here some code:

<body>
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</body>
const URL = 'https://api.adviceslip.com/'
function getAdvice() {
  axios
    .get(url)
    .then((response) => console.log(response)) // success!
    .catch((error) => console.log(error)) // error!
}

Useful resources

  • Advice Slip JSON API - This API helped me to make the app. It's pretty simple to use, no complications.

Author