Research CommonsResearch Commons
cppnet/Installation

Installation

Clone and build cppnet with CMake, optionally using the provided Dockerfile.

cppnet builds with CMake. The repository also ships a Dockerfile for a consistent build environment.

Clone

git clone https://github.com/Research-Commons/cppnet.git
cd cppnet

Build with CMake

mkdir build
cd build
cmake ..
make

This produces the library and the test executables.

Docker

A Dockerfile is provided to encapsulate the build environment and dependencies, keeping builds consistent across machines:

docker build -t cppnet:latest .
docker run --rm -it cppnet:latest bash

Run the tests

The build produces several test executables; run any of them from the build directory:

./test_parser_simple
./test_parser_complex
./test_parser_gtests
./test_post_put
./test_post_patch
./test_post_delete
Dependencies

The HTTP parser is built on llhttp, and handlers use nlohmann/json for JSON payloads. See the repository's CMakeLists.txt for the exact dependency setup.

Next

Continue to the Quickstart to register a route and a handler.