This is an example of a microservice written in C, using the c-framework-service framework and the dependency manager cdeps.
Before getting started, make sure you have cdeps installed. You can follow the installation guide on their repository:
cdeps install
To run the microservice, you need a running database. If you don't have one, the easiest way to set it up is using Docker. You can bring up the database with the following command:
docker-compose up -d db
Once the database is up and running, you can compile and run the microservice:
./run.sh
To test the microservice, you can use curl or any other HTTP client. For example, you can make a request to the microservice using the following curl command:
curl http://localhost:8080/cats\?id\=1