This is a microservice to shorten the URL. So this api performs three task.
-
Get the orignal URL and SAVE in the server and generate the shorten URL.
-
Get All the shorten URL.
-
Decode the URL and send redirct to the oringal url.
The API is hosted in https://small-me.herokuapp.com/
it takes only one input in body called url.
example
{
"url":"www.google.com"
}
in response it gives.
{
"orignalUrl": "https://www.gmail.com/",
"shortUrl": "cY6d80yl9",
}
Response:-
[
{
orignalUrl: "https://www.facebook.com/photo?fbid=1691228797682632&set=a.184052111733649",
shortUrl: "erRXv3zXB"
},
{
orignalUrl: "https://www.gmail.com/",
shortUrl: "cY6d80yl9"
}
]
URL: https://small-me.herokuapp.com/{ short-url }
Example:
https://small-me.herokuapp.com/cY6d80yl9
this will redicet to the gmail.
This might be looking long but when you will have your domain it will look shorter, but the idea behind building the app is same.