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

Shortly-URL-React

react, vite, axios
Youssef Mohammed•320
@YussefMo
A solution to the URL shortening API landing page 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?

I'm most proud of creating a custom hook called useShorten, which handles all the necessary validation and error catching for the URL shortening functionality. This hook streamlined the logic, making the component code cleaner and easier to maintain. Additionally, I focused on building reusable components and ensuring the application was fully responsive across different devices. I also implemented a delete handler function with a delete button, allowing users to easily manage and remove shortened URLs. Leveraging tools like React Hooks helped me build an efficient, modern interface with minimal styling overhead.

What challenges did you encounter, and how did you overcome them?

One of the biggest challenges I faced was dealing with CORS issues when making API requests. The external API I was using didn’t allow cross-origin requests, which initially blocked the app from fetching data correctly.

I explored different solutions like setting up a proxy during development with Vite and trying out CORS proxy services. Eventually, I opted for an API that provided proper authentication tokens and supported cross-origin requests, which made the integration smooth and secure. This experience improved my understanding of how CORS policies work and how to troubleshoot similar issues in the future.

What specific areas of your project would you like help with?

Nothing really, but if anyone knows how to fix the original API CORS request, I'd be grateful.

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 Youssef Mohammed'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