Python Flask Dummy Service
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirementsadditional requirements for running tests
pip install black pytest coverage gunicornexport FLASK_ENV=development
export FLASK_APP=py_dummy_service
flask runvalid values for env:
- development
- testing
- production (default)
you can check available routes using:
export FLASK_APP=py_dummy_service
flask routesYou 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/backendcurl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST localhost:5000/api/v1/backendmake test
make reportmake build
make run
make killTo 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.