Hello World
👋 Hello World
Section titled “👋 Hello World”Let’s build your first Zuno application using CMake FetchContent. This example shows how to create a minimal HTTP server with no external package manager—just modern C++ and CMake.
🧱 Project Structure
Section titled “🧱 Project Structure”hello-world/├── CMakeLists.txt└── main.cpp
📄 CMakeLists.txt
Section titled “📄 CMakeLists.txt”cmake_minimum_required(VERSION 3.20)project(hello_world)
set(CMAKE_CXX_STANDARD 20)set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(zunoGIT_REPOSITORY https://github.com/zuno-framework/zuno.gitGIT_TAG main)
FetchContent_MakeAvailable(zuno)
add_executable(hello-world main.cpp)target_link_libraries(hello-world PRIVATE Zuno::Zuno)
📄 main.cpp
Section titled “📄 main.cpp”#include <zuno/zuno.hpp>
int main() {zuno::App app;
app.get("/", [](Request& req, Response& res) { res.send("Hello from Zuno!");});
app.listen(3000);}
🚀 Run the App
Section titled “🚀 Run the App”cmake -B buildcmake --build build./build/hello-world
You should see:
Zuno server running on http://localhost:3000
Visit http://localhost:3000 in your browser and you’ll see:
Hello from Zuno!
🧭 What’s Next?
Section titled “🧭 What’s Next?”Now that you’ve built your first Zuno app, try:
Zuno + FetchContent = zero friction. Build fast, stay modern.