Giter Site home page Giter Site logo

kmkingman / quoteapi4tests Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 103 KB

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.

License: Boost Software License 1.0

Makefile 0.10% C++ 99.90%
api cpp crow crowcpp learning-resources sqlite3

quoteapi4tests's Introduction

KMCoders Quote Manager

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.

Prerequisites

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.

Building and Running

To build and run the application, follow these steps:

  1. Clone this repository to your local machine.

  2. Navigate to the project directory.

  3. Create a build directory and navigate to it:

    mkdir build
    cd build
  4. Run CMake to generate the build files:

    cmake ..
  5. Build the application:

    make
  6. Run the application:

    ./main

The API will be available at http://localhost:18080.

API Endpoints

GET /

Returns a simple message indicating the API's presence.

GET /all

Retrieves a list of all quotes in JSON format.

POST /add

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"
}

Database

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.

License

This project is licensed under the BSL License

quoteapi4tests's People

Contributors

kmkingman avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.