aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-11-12 19:10:03 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-11-12 19:10:03 +0100
commit28d26d2bd30acac30d71458405b7cc8dd710a1f1 (patch)
treeb90b1c8c03bf496bb34fd4e17301a2184412b1c8 /src/main.zig
parent402888423de9764c22175df4cc41d79157895f3d (diff)
rename to memora
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main.zig b/src/main.zig
index b98b112..2566120 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1,8 +1,8 @@
const std = @import("std");
-const storyboard = @import("storyboard");
+const memora = @import("memora");
pub const std_options = std.Options {
- .logFn = storyboard.log.handler,
+ .logFn = memora.log.handler,
};
const log = std.log.scoped(.main);
@@ -32,15 +32,13 @@ pub fn main() !void {
var writer = connection.stream.writer(&write_buf);
var http_server = std.http.Server.init(reader.interface(), &writer.interface);
- while (true) {
- var request = http_server.receiveHead() catch break;
- log.info("{} {s}", .{request.head.method, request.head.target});
+ var request = http_server.receiveHead() catch continue;
+ log.info("{} {s}", .{request.head.method, request.head.target});
- const handler = storyboard.routes.get(request.head.target);
+ const handler = memora.routes.get(request.head.target);
- handler(&request, allocator) catch |err| {
- log.err("handler({s}): {}", .{request.head.target, err});
- };
- }
+ handler(&request, allocator) catch |err| {
+ log.err("handler({s}): {}", .{request.head.target, err});
+ };
}
}