URL Shortener
This is a Ruby on Rails API app, that provides way to shorten url. It has 2 endpoints:
URL: POST /encode
Request Body
{
"url": "https://codesubmit.io/library/react"
}
Code : 200 OK
Content example
{
"url": "https://codesubmit.io/library/react",
"short_url": "https://short.est/GeAi9K"
}
Code : 400 BAD REQUEST
Content example
{
"error": "The provided URI is not correct -> 'hps://www.'"
}
URL: POST /decode
Request Body
{
"short_url": "https://short.est/GeAi9K"
}
Code : 200 OK
Content example
{
"url": "https://codesubmit.io/library/react",
"short_url": "https://short.est/GeAi9K"
}
Code : 400 BAD REQUEST
Content example
{
"error": "Resource not found"
}