diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-23 07:11:00 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-23 07:11:00 +0200 |
| commit | f109fb62b7e45d54b0c9f524a0707f3c2688b6cb (patch) | |
| tree | e539196b2b97fc3e8f11837c4638288b8494ff80 /src/http/Server.zig | |
| parent | 79ba17323c33c7e7e6b4b3ef526db85f1cf9c086 (diff) | |
add api sketch
Diffstat (limited to 'src/http/Server.zig')
| -rw-r--r-- | src/http/Server.zig | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/http/Server.zig b/src/http/Server.zig new file mode 100644 index 0000000..b6e2d90 --- /dev/null +++ b/src/http/Server.zig @@ -0,0 +1,20 @@ +const std = @import("std"); + +const Self = @This(); + +server: std.Io.net.Server, +io: std.Io.Threaded, + +pub fn init( + gpa: std.mem.Allocator, + address: std.Io.net.IpAddress, +) !Self { + var io: std.Io.Threaded = .init(gpa, .{}); + + return .{ + .io = io, + .server = try address.listen(io.io(), .{ .reuse_address = true }), + }; +} + +pub fn serve(_: *Self) !void {} |