const std = @import("std"); const zap = @import("zap"); fn on_request(r: zap.SimpleRequest) void { if (r.path) |the_path| { std.debug.print("PATH: {s}\n", .{the_path}); } if (r.query) |the_query| { std.debug.print("QUERY: {s}\n", .{the_query}); } _ = r.sendBody("

Hello from ZAP!!!

"); } pub fn main() !void { var listener = zap.SimpleHttpListener.init(.{ .port = 3000, .on_request = on_request, .log = false, }); try listener.listen(); std.debug.print("Listening on 0.0.0.0:3000\n", .{}); // start worker threads zap.start(.{ .threads = 2, .workers = 2, }); }