- Setup local environment
python -m cli_app
python -m cli_app list --help
python -m cli_app get --help
python -m cli_app delete --help
python -m cli_app create --help
python -m cli_app update --help
python -m cli_app delete --help
python -m cli_app search --help
- Setup local environment
export FLASK_APP=http_app
python -m flask run
curl -X GET \
http://127.0.0.1:5000?start=0
curl -X POST \
http://127.0.0.1:5000/ \
-H 'Content-Type: application/json' \
-d '{
"name": "Store name",
"url": "https://store-url",
"address": "Store address",
"lat": 53.3242381,
"lng": -6.3857866
}'
curl -X GET \
http://127.0.0.1:5000/123
curl -X PUT \
http://127.0.0.1:5000/123 \
-H 'Content-Type: application/json' \
-d '{
"name": "Store name",
"url": "https://store-url",
"address": "Store address",
"lat": 53.3242381,
"lng": -6.3857866
}'
curl -X DELETE \
http://127.0.0.1:5000/123
curl -X GET \
'http://127.0.0.1:5000/search?query=store&user_lat=53.3242381&user_lng=-6.3857866&start=0'
- Install and switch to
python 3.6.8
(pyenv
recommended)
- Install virtualenv globally
pip install virtualenv
- Create virtual environment:
virtualenv .venv
- Activate virtualenv:
source .venv/bin/activate
- Run
pip install -r requirements.txt
to install dependencies
- Create
.env
file from .env.example
with proper values