Loading...
The system should:
The system should be:
POST /api/v1/shorten
{
"longUrl": "https://example.com/very/long/url",
"customAlias": "myurl", // optional
"expiry": "2026-01-01" // optional
}
{
"shortUrl": "https://tiny.ly/myurl"
}
GET /{shortCode}
GET /api/v1/analytics/{shortCode}
shortCode → longURLa-z A-Z 0-9 → 62 chars
ID = 1000001 → Base62 → "abc123"
shortCode → longURL
| Column NameTypeDescription | ||
| id | BIGINT PK | Unique ID |
| short_code | VARCHAR | Short URL code |
| long_url | TEXT | Original URL |
| created_at | TIMESTAMP | Creation time |
| expiry_at | TIMESTAMP | Optional expiry |
| click_count | BIGINT | Analytics |