A simple and powerful URL shortener built with Node.js, Express, and MongoDB.
Supports custom short URLs that automatically expire after a specified time — like 30m, 2h, or 3d.
- ✅ Shorten any long URL
- 🕒 Set custom expiry (e.g. 10s, 5m, 2h, 3d)
- 🔁 Auto-redirect to original URL when short URL is visited
- 🗑️ Expired links are automatically deleted using MongoDB TTL
- Node.js
- Express
- MongoDB + Mongoose
nanoidfor short ID generationmsfor parsing human-readable expiry durations
git clone https://github.com/raoulbock/url-shortener.git
cd url-shortener
npm install