Skip to content

recelsus/Template-Crow-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Crow Mock Server Template

Minimal Crow-based mock server exposing a handful of JSON endpoints.

Features

  • GET / returns a JSON message indicating that the server is running.
  • GET /health, /health/live, /health/ready provide simple health probes.
  • GET /echo responds with the request method, path, and query parameters.
  • POST /echo echoes the received body and preserves the Content-Type header when present.

Build Requirements

  • 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:
    brew install asio
    or provide an include path to CMake (e.g. cmake -DASIO_INCLUDE_DIR=/path/to/asio/include ..).

Build & Run

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_server

compile_commands.json is emitted in the build directory and symlinked back to the project root after each build to support clangd and other tooling.

Installing Crow Locally

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 crow

Ensure 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

About

C++23 mock server built with the Crow web framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors