URL Shortening service
Overview
The URL shortening service is used to shorten long URLs. There may be requirement when we want to avoid sending very long urls to the user via SMS, Whatsapp etc, this service compresses the URL.
Pre-requisites
Before you proceed with the configuration, make sure the following pre-requisites are met -
Prior Knowledge of Java/J2EE.
Prior Knowledge of SpringBoot.
Prior Knowledge of REST APIs and related concepts like path parameters, headers, JSON etc.
Key Functionalities
Compress long URLs.
Converted short URLs contains id, which is used by this service to identify and get longer URLs.
Environment Variable | Description |
---|---|
host.name | Host name to append in short URL |
db.persistance.enabled | The boolean flag to store the short URL in database when flag is set as TRUE. |
Deployment Details
Deploy latest version of URL Shortening service
API Details
a) POST /egov-url-shortening/shortener
Receive long urls and converts them to shorter urls. Shortened urls contains urls to endpoint mentioned next. When user clicks on shortened URL, user is redirected to long URL.
b) GET /{id}
This shortened urls contains path to this endpoint. The service uses id used in last endpoint to get long URL. As response the user is redirected to long URL.
Reference Docs
Doc Links
Title | Link |
---|---|
Swagger API Contract | |
Local Setup |