A URL shortening REST API
A URL shortener backend in Node.js/Express: create aliases, redirect with click tracking, per-link stats, expiry and cleanup, backed by atomic JSON persistence.
What's included
- Create alias — custom or generated
- Redirect — 301/302 with click tracking
- Stats — clicks per link, last 24h
- Expiry — optional TTL with cleanup
- Validation — URL + alias rules
- CORS + logging — middleware included
- 36 passing tests — node:test suite
Quick Start
npm install
npm start
Stack
Node.js 18+ · Express · pure ESM
Use cases
- Link management tools
- Marketing tracking links
- Internal URL helpers
- Learning HTTP redirects