Orders microservice
- In shell:
vagrant up
vagrant ssh
cd /vagrant
python run.py
- Then in your browser's address bar type this address:
localhost:5000
If everything works fine, you'll get an HTTP 200
and a pair of braces[]
(because the database is empty).
Please first install httpie
(brew install httpie
).
Then in your terminal please type:
http --json POST :5000/orders price=11.5 prod_id=1 prod_name='bread' status='test' cust_id=9
And if everything works fine, the response is like following:
HTTP/1.0 201 CREATED
Content-Length: 127
Content-Type: application/json
Date: Mon, 15 Oct 2018 19:36:43 GMT
Location: http://localhost:5000/orders/8
Server: Werkzeug/0.14.1 Python/2.7.12
{
"created_on": "Mon, 15 Oct 2018 19:36:43 GMT",
"cust_id": 9,
"id": 8,
"price": 11.5,
"prod_id": 1,
"prod_name": "bread",
"status": "test"
}
Use this link:
http://localhost:5000/orders
Note that Travis CI and codecov have already taken care of building and
testing.
If you prefer to run the test manually, please run:
nosetests
To see code coverage reports, please run:
coverage report -m