clbo/joke-service
Microservice used for teachings at 3rd semester ITA at Kea
251
A simple microservice that serves jokes through RESTful API endpoints.
This service provides various endpoints to retrieve jokes, including options to get all jokes, a random joke, or a specific joke by ID.
docker build -t joke-service .
docker run -p 5000:80 joke-service
pip install -r requirements.txt
python app.py
The service will be available at http://localhost:5000
/api/jokes
GET
[
{
"id": 1,
"setup": "Why don't programmers like nature?",
"punchline": "It has too many bugs!"
},
{
"id": 2,
"setup": "What do you call a bear with no teeth?",
"punchline": "A gummy bear!"
}
]
/api/jokes/random
GET
{
"id": 1,
"setup": "Why don't programmers like nature?",
"punchline": "It has too many bugs!"
}
/api/jokes/<id>
GET
id=[integer]
{
"id": 1,
"setup": "Why don't programmers like nature?",
"punchline": "It has too many bugs!"
}
{
"error": "Joke not found"
}
/health
GET
{
"status": "healthy"
}
joke_service/
├── app.py # Main application file
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
├── .dockerignore # Docker build exclusions
└── README.md # Documentation
docker pull clbo/joke-service