Source: Jolli-sample-repos/url-shortener Last Updated: 4/8/2026
URL Shortener Frontend
Simple HTML/CSS/JavaScript frontend for the URL Shortener API.
Features
- Shorten long URLs with optional custom codes
- Set expiration dates for short URLs
- Copy shortened URLs to clipboard
- View URL statistics (clicks, created date, last accessed)
- Recent URLs history (stored in localStorage)
- Top 10 most clicked URLs leaderboard
- Clean, responsive design
Running the Frontend
-
Make sure the backend is running on
http://localhost:3001 -
Open
index.htmlin your browser or use a simple HTTP server:
# Using Python
python -m http.server 8080
# Using Node.js http-server
npx http-server -p 8080- Navigate to
http://localhost:8080/index.html
File Structure
frontend/
├── index.html # Main page
├── css/
│ └── style.css # All styles
└── js/
└── app.js # Application logicUsage
- Enter a long URL to shorten
- Optionally set a custom code (must be unique)
- Optionally set an expiration date
- Click “Shorten URL” to generate a short link
- Copy the shortened URL or view its statistics
- Recent URLs are saved to browser localStorage
- View the top 10 most clicked URLs at the bottom