Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 560 Bytes

README.md

File metadata and controls

36 lines (28 loc) · 560 Bytes

r0s.io/shorten Server

Endpoints

POST /s - creates a new shortened URL
    200 - if title was successfully created
    410 - if title exists in DB

    Body
    {
        "url": string,
        "title": string
    }
    Response
    {
        "title": string
    }

GET /s/<title> - redirects browser to linked URL
    404 - if title does not exist

Setup

python3 -m venv venv
pip3 install -r requirements.txt

Run

docker-compose up -d # starts a mongoDB instance and a mongo-express instance
./scripts/run.sh