URL Shortener

A simple API to shorten URLs and route them through this domain

Any URL sent to /short/new/ will be returned as a shorten URL within a JSON object. If no protocol is specified in the URL, it will be stored with HTTPS, otherwise it keeps whichever is specified. Any shortened URL sent to /short/ will result in immediate redirection of the user's browser to the stored URL. If the user tries to shorten a URL that has already been shortened, they are sent the original shortened URL - no duplicates will be made

Examples

Example 1:

Input:
/short/new/www.google.com
Expected output:
{'shortUrl': 'https://www.shadesofmarkup.com/short/Yik9L'}

Example 2:

Input:
'https://www.shadesofmarkup.com/short/Yik9L'
Expected output:
<User is redicted to https://www.google.com>

Example 3:

Input:
/short/new/http://www.unsafesite.com
Expected output:
{'shortUrl': 'https://www.shadesofmarkup.com/short/Q7GgmLK'}

Example 4:

Input:
https://www.shadesofmarkup.com/short/Q7GgmLK
Expected output:
<User is redirected to http://www.unsafesite.com>