Url-shortener is a tool for shortening URLs and creating short links.
Spring(Boot, JPA), Swagger, Docker, Gradle, MongoDB, Kotlin
- POST
/api/v1/shorten
Request JSON
{
"fullUrl": "https://www.youtube.com/watch?v=RpIC7z8V5tI"
}
Response JSON
{
"id": "KQi69xn",
"fullUrl": "https://www.youtube.com/watch?v=RpIC7z8V5tI"
}
- GET
/api/v1/short-url/KQi69xn
Response JSON
{
"id": "TCGoCYS",
"fullUrl": "https://www.youtube.com/watch?v=RpIC7z8V5tI"
}
To run this application you need to create .env
file in root directory with next environments:
MONGO_AUTHENTICATION_DATABASE
- mongoDB Authentication DatabaseMONGO_DATABASE
- name of MongoDBMONGO_PORT
- port of MongoDBMONGO_HOST
- host of MongoDB
- Clone this repo into folder.
git clone https://github.com/qReolq/url-shortener.git
cd url-shortener
- Start docker compose
docker compose up
- Go to localhost:8080/swagger-ui/index.html#/
At the core of this URL shortener is an algorithm that compresses the original link into a 7-character representation. The algorithm employs a character set of 62 symbols