project to shorten the url
requirements -
docker redis maven
docker pull redis
- mvn clean install
- docker-compose up --build
redis db image - https://hub.docker.com/r/akhiljns/redis <br />
url shortner app image - https://hub.docker.com/r/akhiljns/urlshortner <br />
these images can be pulled and run directly on local docker containers
docker pull akhiljns/redis:v1 <br />
docker pull akhiljns/urlshortner:v1 <br />
docker run akhiljns/redis:v1 <br />
docker run akhiljns/urlshortner:v1 <br />
refer urlshortner.postman_collection.json file
POST request to generate the shorten url
headers : content-type application/json
url : http://localhost:10095/rest/url
json body :
{
"url" : "https://www.facebook.com/"
}
<br />
response { shortned Url = https://shorturl/0e2d9959 }
where id is 0e2d9959 i.e. https://shorturl/{id}
GET request to fetch original url from id generated
0e2d9959 is the {id}
http://localhost:10095/rest/url/0e2d9959