⚡ZAP⚡

Unleash the Low-Level Power of Zig for Blazingly Fast and Robust Web Applications.

Blazingly Fast Performance

Zap leverages the facilitation of the powerful evented networking C library, facil.io, to deliver exceptional speed.

Robust and Stable Operation

With over six months of successful production use, Zap has proven to be extremely robust and stable.

Memory-Safe Development

Zap is built with Zig's strengths in mind, ensuring memory safety and error handling.

TLS/HTTPS Support

Zap supports secure communication with TLS/HTTPS, allowing for encrypted data transmission.

Hello, Zap!

Getting started with Zap is simple! Take a look at the learn page to see what else Zap can do or jump straight into the docs.

const std = @import("std");
const zap = @import("zap");

fn on_request(r: zap.Request) void {
    r.sendBody("Hello, Zap!") catch return;
}

pub fn main() !void {
    var listener = zap.HttpListener.init(.{
        .port = 3000,
        .on_request = on_request,
        .log = true,
        .max_clients = 100000,
    });
    try listener.listen();

    std.debug.print("Listening on 0.0.0.0:3000\n", .{});

    zap.start(.{
        .threads = 2,
        .workers = 1, // 1 worker enables sharing state between threads
    });
}