Python Flask Dummy Service
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements
additional requirements for running tests
pip install black pytest coverage gunicorn
export FLASK_ENV=development
export FLASK_APP=py_dummy_service
flask run
valid values for env:
- development
- testing
- production (default)
you can check available routes using:
export FLASK_APP=py_dummy_service
flask routes
You can use the /api/v1/<path>
to simulate CRUD API endpoints.
You also have two endpoints that can help with simulations:
- /api/v1/headers (returns request headers)
- /api/v1/status/<status> (returns <status>)
You can also use /be
to simulate communication to a backend.
The backend url can be set using:
export BACKEND_URL="http://localhost:5000"
you can then use:
- /be/status/<status>
- /be/<path>
curl -d "param1=value1¶m2=value2" -X POST localhost:5000/api/v1/backend
curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST localhost:5000/api/v1/backend
make test
make report
make build
make run
make kill
To send traces to Jaeger set the JAEGER_HOST
environment variable.
Read the pre-commit hooks document for more info.
Read the git-chglog document for more info.