Skip to content

athenian-programming/web-services-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Services Demo

Setup

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

Running the server

Local

Start the server with:

python3 src/server.py

Ngrok

Install ngrok with:

brew cask install ngrok

Launch ngrok with:

ngrok http 8080

Deploying to repl.it

Run on Repl.it

Deploying to Heroku

Deploy

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

CLI Calls

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

Programmatic Calls

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"

Related Posts

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages