This web-app has the following features:
- URL shortener Home Page: It provides you an input field in which you can enter your long Url which you want to shorten
- Recently Shortened URLs list page: It shows all the recently shortened Urls in a table.
- Error Page: It will show you an error page in case you entered a wrong Url.
GET /urls/
Sample Response Body:
{
"zmdKXWB8F": "https://github.com/sanchit2812/url-length-shortener",
"7xTC-U_ky": "https://github.com/sanchit2812/url-length-shortener/blob/master/app.js"
}
Status: 200, 404 ("No urls present");
POST /urls
Sample Request Body:
{
"longUrl" : "https://github.com/sanchit2812/url-length-shortener/blob/master/app.js"
}
GET /url/:shortUrlId
Sample Response Body:
{
"longUrl" : "https://github.com/sanchit2812/url-length-shortener/blob/master/app.js"
}
(It redirects to the Url's link)
Status: 200, 404 ("This URL is not shortened by our service")