Node.js Backend Fundamentals

Lesson 6 of 6

Final Project: URL Shortener

Time to put it all together. Build a URL shortener API with:

Requirements

  1. POST /api/links, accepts a long URL, returns a short code.
  2. GET /:code, redirects to the original URL.
  3. GET /api/links/:code/stats, visit count and creation date.
  4. Persist links in PostgreSQL.
  5. Validate URLs and handle unknown codes with a 404.

Stretch goals

  • Rate limiting
  • Custom short codes
  • Expiring links

Submit your repository link below when you are done, an instructor will review it before you can mark this lesson complete. Good luck! 🚀

This lesson ends in a project. Build it on your own machine, there's nowhere to submit it here, but the brief above is everything you need.