a Link shortener made during freecodecamp: project requirements page
live version on: https://lien.glitch.me
Create short links: https://lien.glitch.me/new/[original_url]
original_url must be a valid URL.
response:
{
"short-url": SHORTURL,
"original-url": ORIGINALURL
}
example: https://lien.glitch.me/new/https://facebook.com
response:
{
"short_url":"C",
"original_url":"https://facebook.com"
}
short link: https://lien.glitch.me/C
in case of an invalid url: http status code 400
{
"error": "unvalid URL"
}
else http status code 500:
{
"error": "database error"
}
simple webpage that consumes the api. I used Storage API to save recently shortened links.