A REST API and CLI program written in C
A Linux OS and the gcc
compiler are needed.
To compile the code, clone the repo, and run the following commands.
$ git clone https://github.com/filipebafica/c_rest_api.git
$ cd c_rest_api
$ make
This is going to generate two executables named server
and cli
.
To run the server:
./server
To run the cli:
./cli
Currently the API provides the method GET
in two paths:
1 - Root path: /
which will return all books from the database
2 - Book path /book
which will return a specific book from the database. The query must follow the pattern /book?id=[book_id]
The cli program will return the number of requests made to the API since the last time the server was started: