Skip to content

the-gigi/quote-service

Repository files navigation

quote-service

A simple web service that manages quotes.

It supports the following operations:

  • Add quote
  • Get all quotes

The quotes are stored in redis

The code here accompanies this article: Introduction to Docker and Kubernetes

Running the server locally via docker-compose

docker-compose up

Running the server locally the hard way

Create the virtual environment

pipenv install

Install docker

see https://docs.docker.com/install/

Launch Redis locally

docker run -p 6379:6379 redis

Launch the quote service

pipenv shell hug -f app.py

Usage via cURL

Get all quotes:

curl http://localhost:8000/quotes

Add a quote:

curl http://localhost:8000/quotes -d "quote=We must be very careful when we give advice to younger people: sometimes they follow it! ~ Edsger W. Dijkstra"

Usage via httpie

Get all quotes:

http http://localhost:8000/quotes

Add a quote:

http --form http://localhost:8000/quotes quote="We must be very careful when we give advice to younger people: sometimes they follow it! ~ Edsger W. Dijkstra"

About

A simple web service that manages quotes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published