https://github.com/rahul07bagul/cppcrowserver
https://github.com/rahul07bagul/cppcrowserver
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rahul07bagul/cppcrowserver
- Owner: rahul07bagul
- Created: 2024-10-28T02:46:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T02:59:20.000Z (about 1 year ago)
- Last Synced: 2024-10-28T06:25:21.579Z (about 1 year ago)
- Language: C++
- Size: 5.71 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crow Web Server in C++
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.
## Prerequisites
- **Operating System**: Windows
- **Tools Required**:
- [Visual Studio Code (VS Code)](https://code.visualstudio.com/)
- [CMake](https://cmake.org/download/)
- [vcpkg](https://github.com/microsoft/vcpkg) - C++ package manager
## Setup and Installation
### 1. Clone this repository and open in VS Code
### 2. Install `vcpkg` and Set Up Dependencies
1. Clone the `vcpkg` repository and install Crow and Asio dependencies:
Open terminal in root directory and execute below commands-
```bash
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg install crow asio
.\vcpkg integrate install
```
### Build the Project
1. Configure CMake to use `vcpkg`:
- In `.vscode/settings.json`, add:
```json
{
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/vcpkg/scripts/buildsystems/vcpkg.cmake"
}
}
```
2. 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`.
### 3. Run the Application
To run the server:
```bash
cd build/Debug
.\MyCrowProject.exe
```
Navigate to `http://localhost:8080` in a web browser to see the message `"Hello, World!"`.