Skip to content

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.


hello-world/
├── CMakeLists.txt
└── main.cpp

cmake_minimum_required(VERSION 3.20)
project(hello_world)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
zuno
GIT_REPOSITORY https://github.com/zuno-framework/zuno.git
GIT_TAG main
)
FetchContent_MakeAvailable(zuno)
add_executable(hello-world main.cpp)
target_link_libraries(hello-world PRIVATE Zuno::Zuno)

#include <zuno/zuno.hpp>
int main() {
zuno::App app;
app.get("/", [](Request& req, Response& res) {
res.send("Hello from Zuno!");
});
app.listen(3000);
}

Terminal window
cmake -B build
cmake --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!

Now that you’ve built your first Zuno app, try:


Zuno + FetchContent = zero friction. Build fast, stay modern.