customer squads of a e-commerce website
vagrant up
vagrant ssh
cd /vagrant
nosetests
FLASK_APP=service:app flask run --host=0.0.0.0 --port=5000
Then on your own machine, you can see by visiting: http://localhost:5000/
-
POST
/customers
Body: JSON containing following fields- first_name - String
- last_name - String
- user_id - String
- password - String (at least 6 characters long)
- address - JSON containing:
- street - String
- apartment - String
- city - String
- state - String
- zip_code - String
Example:
{
"first_name": "John",
"last_name": "Doe",
"user_id": "jhd345",
"password": "Asdf@1234",
"address": {
"street": "48 John St",
"apartment": "1B",
"city": "New York",
"state": "New York",
"zip_code": "22890"
}
}
- GET
/customers/{user_id}
- PUT
/customers/{user_id}
- DELETE
/customers/{user_id}
- GET
/customers
- GET
/customers?param={value}
Choices of param:- fname - first name (String)
- lname - last name (String)
- uid - user id (String)
- city - city of primary address (String)
- state - state of primary address (String)
- zip - zip code of primary address (String)
- PUT
/customers/{user_id}/deactivate
- PUT
/customers/{user_id}/activate
Run the tests using nose
nosetests