URL Shortener Microservice

This is a simple application made for the freeCodeCamp course's task. You can pass a URL as a parameter and you will receive a shortened URL in the JSON response.

If you pass an invalid URL that doesn't follow the valid http://example.com or https://example.com format, the JSON response will contain an error instead.It is only an educational project so you can't add any path to the domain (after .com or after other domains, subdomains are allowed). This is simple regex validation condition ^[htp]{4}[s]?[:/]{3}([a-z]+[.])+[a-z]+$

Example usage:

https://fcc-be-urlshortener.glitch.me/http://google.com
https://fcc-be-urlshortener.glitch.me/https://google.com

Example output:

{"originalUrl":"http://google.com","shortUrl":"3"}

When you visit that shortened URL:

https://fcc-be-urlshortener.glitch.me/3

it will redirect you to original page.