Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 11 months ago

Advice generator app with VueJS and Fetch API

vue, fetch
Karen Garza•100
@KarenNR
A solution to the Advice generator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

What am I most proud of?

  • I disabled the button while data is being fetched. This prevents the user from sending multiple requests before they're completed.
  • I used "no-cache" so that advices are not repeated.
  • I used environmental variables and successfully configured them in Vercel while deploying them.

What would I do differently next time?

  • I actually wanted to try this on Next.JS (maybe "next" time, hahaha)
What challenges did you encounter, and how did you overcome them?
  • CORS error: I had a CORS error after deploying. I eventually found out this was because I was defining headers on the fetch request. This took too many redeploys on Vercel.
  • Changing the image depending on the screen size: I used media queries on JavaScript (window.matchMedia("(max-width: 767.98px)"))
What specific areas of your project would you like help with?
  • In mobile, I don't know why the size is larger than the screen (vertically). I defined the height of the container to 100vh.
  • Any other comments are welcome!
Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Karen Garza's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License