- /
- returns a list of all urls in the API and their description
- /<hash>
- url redirector based on short url
- /shrink/
- url shortener
- returns json of url and its shortened form
- POST request data format
{"u":"<url_to_be_shortened>"}
- /s/
- search url using title
- returns list of matching page titles
- POST request data format
{"q":"<title_to_be_searched>"}
- /meta/
- returns list metadata links for shourturls
- /meta/<hash>
- returns a json of metadata of the short url
- python3
- virtualenv==13.1.2
- cd to the root of the project folder in the terminal
- run the command to create a virtualenv for the project:
$ virtualenv -p python3 venv
- run the command to switch to virtualenv:
$ source venv/bin/activate
- install required libraries to the using pip as follows:
$ pip install -r requirements.txt
- run command to start server:
$ python app.py
- goto http://localhost:8888/ to access the API