- Create a python virtual environment.
- Update the SHORTENER_WEB_SERVER value in the .flaskrun file.
- Install dependencies
pip install -r requirements.txt
- Run flask server
flask run --host=0.0.0.0
- Update the SHORTENER_WEB_SERVER value in the .flaskrun file.
- Create a urlshortener container
docker-compose up
curl http://127.0.0.1:5000/api/shorten -X POST -H 'Content-Type:application/json' -d '{"url":"https://google.com"}'
- Install dev dependencies
pip install -r requirements_dev.txt
- Run test cases
pytest -v