Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 843 Bytes

SETUP.md

File metadata and controls

71 lines (52 loc) · 843 Bytes

URL Shortener

Setup

  1. Install dependencies:

    bundle install
  2. Setup database:

    rails db:create db:migrate
  3. Run the server:

    rails s

Running tests

rspec

Encode Endpoint API

URL: POST /encode

Request Body

{
  "url": "https://codesubmit.io/library/react"
}

Success Response

Code : 200 OK

Content example

{
  "url": "https://codesubmit.io/library/react",
  "short_url": "https://short.est/GeAi9K"
}

Decode Endpoint API

URL: POST /decode

Request Body

{
  "short_url": "https://short.est/GeAi9K"
}

Success Response

Code : 200 OK

Content example

{
  "url": "https://codesubmit.io/library/react",
  "short_url": "https://short.est/GeAi9K"
}