╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ serve.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
643 code: u16, 644 message: []const u8, 645 content_type: []const u8, 646 body: []const u8, 647 ) !void { 648 try http_server.out.print( 649 "HTTP/1.1 {d} {s}\r\nContent-Type: {s}\r\nContent-Length: {d}\r\n\r\n{s}", 650 .{ code, message, content_type, body.len, body }, 651 ); 652 } 653 654 fn logError(err: *std.Io.Writer, comptime fmt: []const u8, args: anytype) void { 655 err.print(fmt, args) catch return; 656 err.flush() catch {}; 657 } 658