Minimal Crow-based mock server exposing a handful of JSON endpoints.
GET /returns a JSON message indicating that the server is running.GET /health,/health/live,/health/readyprovide simple health probes.GET /echoresponds with the request method, path, and query parameters.POST /echoechoes the received body and preserves theContent-Typeheader when present.
- C++23 compatible compiler
- CMake 3.20 or newer
- Crow library available locally (for example under
third_party/crow) - Standalone Asio headers (Crow depends on them). On macOS you can install via Homebrew:
or provide an include path to CMake (e.g.
brew install asio
cmake -DASIO_INCLUDE_DIR=/path/to/asio/include ..).
cd /path/to/Template-Crow-Framework
mkdir -p build
cmake -S . -B build -DASIO_INCLUDE_DIR=$(pwd)/third_party/asio/asio/include
cmake --build build
./build/crow_mock_servercompile_commands.json is emitted in the build directory and symlinked back to the project root after each build to support clangd and other tooling.
If you do not already have Crow installed, fetch a release archive and place it under third_party/crow:
mkdir -p third_party
cd third_party
wget https://github.com/CrowCpp/Crow/releases/download/v1.2.1.2/Crow-1.2.1-Linux.tar.gz
tar -xzf Crow-1.2.1-Linux.tar.gz
mv Crow-1.2.1-Linux crowEnsure the extracted directory contains lib/cmake/Crow/CrowConfig.cmake; the CMakeLists.txt expects that layout when locating the Crow package.
If Asio is not available system-wide, you can vendor the standalone headers alongside the template and point CMake to them:
cd /path/to/Template-Crow-Framework
git clone https://github.com/chriskohlhoff/asio.git third_party/asio
cmake -S . -B build -DASIO_INCLUDE_DIR=$(pwd)/third_party/asio/asio/include