A simple URL shortener application built using Spring Boot and Elasticsearch.
- Shorten long URLs into compact links
- Redirect to the original URL when accessing the shortened link
- Store and retrieve shortened URLs efficiently using Elasticsearch
- User-friendly API for creating and managing shortened links
- Spring Boot: Framework for building the application
- Elasticsearch: Search engine for storing and retrieving URL data
- Maven: Dependency management and build tool
Method | Endpoint | Description | Request Body | Response |
---|---|---|---|---|
Post | /shortLink |
Shortens a long URL | "urlPlain":"http://google.co12" |
Shortened URL with unique value |
Post | /url/{uniqueValue} |
Shortens a long URL | Pass unique value as PathVariable | Redirect to original URL |
The test URL I created by redirecting with Ngrok ended up being ironically long.
- Java 11 or higher
- Maven
- Elasticsearch (version 8.x or compatible)
-
Clone the repository:
git clone https://github.com/root14/link-shorter.git cd link-shorter