(SWAPI is a wrapper for search people using SWAPI API)
python 3.8
pip 20.0.2
- To create new env =>
python3 -m venv venv
Or using the system libs =>python3 -m venv venv --system-site-packages
- To activate the currnt env =>
source venv/bin/activate
- To install the requirements =>
pip3 install -r requirements.txt
- Run the app
python3 run.py
- Goto
http://127.0.0.1:5000/api/characters/?name=Luke
- To run the test
pytest -s
(inside the venv)
- Build the image
docker build . --tag swapi_api
- Run the image
docker run --name swapi_rest_web -p 5000:5000 swapi_api
- Running the test
- Run to attach your terminal to the image
docker exec -it swapi_rest_web /bin/bash
- Run the test
pytest -s
- Run to attach your terminal to the image
- Simply run
docker-compose up
- Running the test
- Run to attach your terminal to the image
docker exec -it swapi_rest_web /bin/bash
- Run the test
pytest -s
- Run to attach your terminal to the image