//! This is the main executable file. //! Here we will add all cli interfaces //! to interact with the state of the application //! but also the actual running of the server / webapp. const std = @import("std"); const http = @import("http"); const html = @import("html"); const z = @import("z"); const Static = http.handler.Static; const components = @import("web/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("web/pinch.js")), z.style.load(@embedFile("web/index.css")), z.env(components), })), .native(.body, .{}, .children(&.{ z.html.load(@embedFile("web/index.html")), })), })); const routes: http.RouteSet = .init(&.{ Static(.index, document.toDocument()).interface(), }); pub fn main(init: std.process.Init) !void { var server: http.Server = try .init( init.gpa, try .parseLiteral("0.0.0.0:8080"), routes, ); try server.serve(init.gpa); } test { _ = std.testing.refAllDecls(@This()); }