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