- Python 3.7+
Clone this repository,
git clone https://github.com/abhishektiwari/mock-order-api.git
cd mock-order-api
Create virtualenv,
python -m venv venv
Then activate virtualenv
and install requirements,
source venv/bin/activate
pip install -r requirements-dev.txt
Set environment variables,
export FLASK_APP=api.py
export FLASK_ENV=development
Create a .env
file and add following configs (see .sample-env
),
BASIC_AUTH_USERNAME=<your-username>
BASIC_AUTH_PASSWORD=<your-password>
flask run
You will need Postman app installed locally. Postman collection is included in this repository. Import the collection in your Postman, setup environment variables api_endpoint
(i.e. http://localhost:5000), customerNo
and basic authentication username
/password
.
Click send and review response Body
.
One-click deploy to Heroku. You will need a Heroku account which you can create for free.
Demo API Endpoint: https://mock-order-api.herokuapp.com
Username: keanu
Password: matrix