Skip to content

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

Notifications You must be signed in to change notification settings

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

No packages published