/c_rest_api

A REST API and CLI program written in C

Primary LanguageC

REST API & CLI

A REST API and CLI program written in C

🗂 Table of Contents

🏁 Getting Started

A Linux OS and the gcc compiler are needed.

⚙️ Installing

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

🌐 REST API

Currently the API provides the method GET in two paths:

1 - Root path: / which will return all books from the database image

2 - Book path /book which will return a specific book from the database. The query must follow the pattern /book?id=[book_id] image

💻 CLI

The cli program will return the number of requests made to the API since the last time the server was started: image

📚 Main External Libraries Used