Zap leverages the facilitation of the powerful evented networking C library, facil.io, to deliver exceptional speed.
With over six months of successful production use, Zap has proven to be extremely robust and stable.
Zap is built with Zig's strengths in mind, ensuring memory safety and error handling.
Zap supports secure communication with TLS/HTTPS, allowing for encrypted data transmission.
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 }); }