aboutsummaryrefslogtreecommitdiff
path: root/src/http/Server.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/Server.zig')
-rw-r--r--src/http/Server.zig20
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 {}