Skip to content

RaoulBock/URL-SHORTENER-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔗 URL Shortener with Expiry - Node.js, Express, MongoDB

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.


🚀 Features

  • ✅ 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

🛠 Tech Stack

  • Node.js
  • Express
  • MongoDB + Mongoose
  • nanoid for short ID generation
  • ms for parsing human-readable expiry durations

📦 Installation

git clone https://github.com/raoulbock/url-shortener.git
cd url-shortener
npm install

About

A simple URL shortener built with Node.js, Express, MongoDB, and NanoID. Generate short links and redirect users to the original URLs.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors