Tested on:
- Description: Ubuntu 22.04.2 LTS
- Release: 22.04
- Codename: jammy
- Python: 3.10.6
- pip: 22.1.2
- env: (GNU coreutils) 8.32
Instructions:
- Clone the repository
cd venv && source venv/bin/activate
python3 url.py
- On Postman:
- set METHOD to POST
- set the url to
http://localhost:5000
- set key to
url
- set value to <any_url>
http://www.youtube.com
- send and generated link is stored inside url_map.txt
- On Curl:
curl -d "url=http://www.youtube.com" -X POST http://localhost:5000/
- On Docker:
cd dockerized
docker build -t my-shortener-app .
docker run -p 5000:5000 my-shortener-app
- To test the service, run the bash script:
- make sure the service is up and running
- from
venv
folder, make the test file executablesudo chmod +x test.sh
- then run
./test.sh