This is a simple web API for managing quotes. It uses the Crow C++ web framework and SQLite for data storage. The API allows you to add quotes and retrieve a list of all quotes.
Before running this application, make sure you have the following dependencies installed on your system:
- CMake
- Clang++ (C++ compiler)
- SQLite3
- Crow C++ Web Framework
- nlohmann/json Library
You can install these dependencies using your package manager or build tools like Nix.
To build and run the application, follow these steps:
-
Clone this repository to your local machine.
-
Navigate to the project directory.
-
Create a build directory and navigate to it:
mkdir build cd build
-
Run CMake to generate the build files:
cmake ..
-
Build the application:
make
-
Run the application:
./main
The API will be available at http://localhost:18080
.
Returns a simple message indicating the API's presence.
Retrieves a list of all quotes in JSON format.
Adds a new quote. You must provide the quote content and author in the request body as JSON.
Example request body:
{
"content": "This is a sample quote.",
"author": "Muhammad Kurkar"
}
The application uses SQLite as its database. The database file is named "KMCodersQM.db" and will be created in the project directory if it doesn't already exist. The database schema includes a "posts" table for storing quotes.
This project is licensed under the BSL License