From f39dfd01ab06cf92a3bcad75fcb175a8242ec1b1 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 6 Jun 2026 09:38:56 +0200 Subject: Remove Server struct and replace it with single function --- src/web/root.zig | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/web/root.zig (limited to 'src/web/root.zig') diff --git a/src/web/root.zig b/src/web/root.zig new file mode 100644 index 0000000..c9c1b08 --- /dev/null +++ b/src/web/root.zig @@ -0,0 +1,27 @@ +const z = @import("z"); +const html = @import("html"); +const http = @import("http"); +const Static = http.handler.Static; + +const components = @import("component/root.zig").components; + +const document: html.Element = .native(.html, .{}, .children(&.{ + .native(.head, .{}, .children(&.{ + .native(.title, .{}, .content("Memora")), + .native(.meta, .{ + .name = "viewport", + .content = "width=device-width, initial-scale=1.0", + }, .void), + z.script.load(@embedFile("pinch.js")), + z.style.load(@embedFile("index.css")), + z.env(components), + })), + .native(.body, .{}, .children(&.{ + z.html.load(@embedFile("index.html")), + })), +})); + +pub const interfaces: []const http.handler.Interface = &.{ + Static(.index, document.toDocument()).interface(), +}; + -- cgit v1.2.3-70-g09d2