Set of API endpoints to be consumed by a store manager application
Set of API endpoints to be consumed by a store manager application
The Program offers the following set of endpoints:
EndPoint | Functionality | Notes |
---|---|---|
GET /products | Fetch all products | Get all available products. |
GET /products/[productId] | Fetch a single product record | Get a specific product using the |
GET /sales | Fetch all sale records | Get all sale records. |
GET /sales/[saleId] | Fetch a single sale record | Get a specific sale record using its id |
POST /sales | Create a sale order | Create a sale record. |
POST /products | Create a product | Create a product. |
These instructions will get you a copy of the program on your local machine for development and testing purposes. The instructions are tailored for uses of LINUX OS
particularly UBUNTU
What things you will need to run the application
Python3
version: 3.6
Pip for python3
$ sudo apt-get install python3-pip
Flask to build the application
version: 1.0.2
$ pip install flask
Virtualenv to create a virtual environment
version: 16.0.0
Pytest to perform tests
version: 3.9.1
$ pip install pytest -U
Alternatively, run pip install -r requirements.txt
to install all the necessary tools
Flask - microframework for Python
To have a copy of the project on your machine, run the command below in your preferred directory:
git clone https://github.com/dxania/Store_Manager_APIs.git
After cloning, you will have a folder named Store_Manager_APIs
Store_Manager_APIs
python3 -m venv <name of virtualenvironment>
source <name of virtualenvironment>/bin/activate
export FLASK_APP=store_mgr.py
thenflask run
pytest
or pytest tests/<test_file_name>
in the directory of the project to run unit testsDeployed on heroku. Visit the this link to interact with the deployed app