Install Http Toolkit
Install httpie with:
brew install httpie
Clone the repo with:
git clone https://github.com/athenian-robotics/web-services-demo.git
Install the required python packages with:
pip install -r requirements.txt
Start the server with:
python3 src/server.py
Install ngrok with:
brew cask install ngrok
Launch ngrok
with:
ngrok http 8080
Create a new Heroku app with:
heroku create [APP_NAME]
Deploy code to Heroku with:
git push heroku master
Open Heroku app in browser with:
heroku open
or visit http://APP_NAME.herokuapp.com
.
View server logs with the heroku logs
command with:
heroku logs --tail
Say hello with:
http :8080/plain-hello
http :8080/html-hello
Query all customers with:
http :8080/customers
Query customers by id with:
http :8080/customers/1
http :8080/customers/2
http :8080/customers/3
Query customers by name with:
http :8080/customer_query?name=Bill
Add values via POST with:
http :8080/customers name='Joe Jackson'
http :8080/customers
http :8080/customers name='Jill West' address='456 Sycamore Lane'
http :8080/customers
Query all customers with:
src/all_customers.py
Query customers by id with:
src/customer_by_id.py -i 1
src/customer_by_id.py -i 2
src/customer_by_id.py -i 3
Query customers by name with:
src/customer_by_name.py -n Bill
Create a new customer with:
src/create_customer.py -n "Mike Bryant" -a "1831 Dupont St"