Skip to content

yonatankarp/cat-fact-service

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

Cat Fact Service

Type Status
CI pipelines Release Gradle Upgrade Linters

A simple cat fact service application, service a JSON endpoint and using the cat-fact client library to get the facts about cats.

This is the example application described in the article LINK TO ARTICLE

Running the project

To build the project, run the following commands:

$ ./gradlew build
$ docker compose up

You can now hit the endpoint

$ curl http://localhost:8080/api/v1/cat/facts

You can set the number of facts (1 to 10) using the query parameter max as follows:

$ curl http://localhost:8080/api/v1/cat/facts?max=3

If the value is higher than 10, it would be clamped to 10, and if it is lower than 1, it would be clamped to 1.

Alternatively, you can pull the final docker image from GHCR:

$ docker pull ghcr.io/yonatankarp/cat-fact-service:latest

Authors

About

A weather services services JSON response using the WeatherApi client

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •