diff --git a/examples/hello/hello.zig b/examples/hello/hello.zig
index 13f4545..fd5dbc2 100644
--- a/examples/hello/hello.zig
+++ b/examples/hello/hello.zig
@@ -1,27 +1,17 @@
const std = @import("std");
const zap = @import("zap");
-fn on_request(request: [*c]zap.C.http_s) callconv(.C) void {
- std.debug.print("GOT A REQUEST!\n", .{});
- // std.time.sleep(5 * 1000 * 1000);
- _ = zap.sendBody(request, "Hello from ZAP!!!");
+fn on_request(r: [*c]zap.C.http_s) callconv(.C) void {
+ _ = zap.sendBody(r, "
Hello from ZAP!!!
");
}
pub fn main() !void {
- // std.debug.print("debug1\n", .{});
- // configure
- var listen_settings: zap.ListenSettings = .{};
- // std.debug.print("debug2\n", .{});
- listen_settings.on_request = on_request;
- listen_settings.log = true;
-
- // std.debug.print("debug3\n", .{});
-
// listen
- try zap.listen("3000", null, listen_settings);
- std.debug.print("Listening on port 3000\n", .{});
-
- // std.debug.print("debug4\n", .{});
+ try zap.listen("3000", null, .{
+ .on_request = on_request,
+ .log = true,
+ });
+ std.debug.print("Listening on 0.0.0.0:3000\n", .{});
// start working
zap.start(.{