###Objective: Build a full stack JavaScript app that is functionally similar to this: reference case and deploy it to Heroku. ###User story:
- user can
pass a URL as a parameter and than
receive a shortened URL in the JSON response. - If user pass an invalid URL
that doesn't follow the validhttp://www.example.com
format,
the JSON response will contain
an error instead. - When user visit that shortened URL,
it will redirect to the original link.
###Usage example:
- creating short link from valid URL:
input:
https://api-url-shortener-microservice.herokuapp.com/new/http://freecodecamp.com/news
output:
{ "original_url": "http://freecodecamp.com/news", "short_url": "https://api-url-shortener-microservice.herokuapp.com/4" }
- using created short link: input: https://api-url-shortener-microservice.herokuapp.com/cnn output: redirect to http://freecodecamp.com/news
- creating short link from invalid (or non existed) URL:
input:
https://api-url-shortener-microservice.herokuapp.com/new/invalid_URL/?allow=true
output:
{ "original_url": "invalid_URL/", "short_url": "https://api-url-shortener-microservice.herokuapp.com/eRR" }