This project is a basic setup for creating a web server using the Crow framework in C++. Follow the steps below to install necessary tools, set up the project structure, and run a simple Crow server.
- Operating System: Windows
- Tools Required:
- Visual Studio Code (VS Code)
- CMake
- vcpkg - C++ package manager
-
Clone the
vcpkg
repository and install Crow and Asio dependencies: Open terminal in root directory and execute below commands-git clone https://github.com/microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat .\vcpkg install crow asio .\vcpkg integrate install
-
Configure CMake to use
vcpkg
:-
In
.vscode/settings.json
, add:{ "cmake.configureSettings": { "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/vcpkg/scripts/buildsystems/vcpkg.cmake" } }
-
-
Run CMake: Configure from command palette and after that use build button which is at the bottom of the VS Code. The executable will be created in
build/Debug
.
To run the server:
cd build/Debug
.\MyCrowProject.exe
Navigate to http://localhost:8080
in a web browser to see the message "Hello, World!"
.