⚡ Powered by Zig

The Web Framework for
Modern Zig Era

H(TTP) server framework built for high performance and safety running on Zig. Zero dependencies, memory safe, and blazingly fast.

0
Dependencies
100%
Memory Safe
Blazingly Fast
main.zig
const std = @import("std");
const h3 = @import("h3");

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();

    var app = try h3.createApp(gpa.allocator());
    defer app.deinit();

    _ = app.get("/", homeHandler);
    _ = app.get("/api/users/:id", getUserHandler);

    try h3.serve(&app, .{ .port = 3000 });
}

fn homeHandler(event: *h3.Event) !void {
    try h3.sendJson(event, .{
        .message = "Hello from h3z!",
        .framework = "h3z",
        .language = "Zig"
    });
}

fn getUserHandler(event: *h3.Event) !void {
    const id = h3.getParam(event, "id") orelse "unknown";
    try h3.sendJson(event, .{
        .id = id,
        .name = "Zig Developer",
        .framework = "h3z"
    });
}

Why Choose h3z?

Built with Zig's philosophy of optimal performance and safety

Blazingly Fast

Built with Zig for maximum performance. Zero-cost abstractions and compile-time optimizations.

🛡️

Memory Safe

Zig's compile-time memory safety guarantees. No undefined behavior, no memory leaks.

📦

Zero Dependencies

Pure Zig implementation with no external dependencies. Minimal attack surface and easy deployment.

🧩

Composable

Modular architecture with middleware support. Build exactly what you need, nothing more.

🔒

Type Safe

Compile-time type checking and safety. Catch errors before they reach production.

🌍

Cross Platform

Runs on Linux, macOS, Windows, and more. One codebase, everywhere Zig runs.

Get Started in Minutes

Create your first h3z application with just a few commands

1

Install Zig

curl -sSL https://ziglang.org/download/ | sh
2

Create Project

zig init
3

Add h3z Dependency

// Add to build.zig.zon
.dependencies = .{
    .h3 = .{
        .url = "https://github.com/dg0230/h3z/archive/main.tar.gz",
        .hash = "12345..." // zig will provide this
    }
}
4

Run Your Server

zig build run